Google Maps API v2 for Android

ParameterDetails
GoogleMapthe GoogleMap is an object that is received on a onMapReady() event
MarkerOptionsMarkerOptions is the builder class of a Marker and is used to add one marker to a map.

Custom Google Map Styles

Map Style

Google Maps come with a set of different styles to be applied, using this code:

The different map styles are:

Normal

Typical roadmap. Roads, some man-made features, and important natural features such as rivers are shown. Road
and feature labels are also visible.

Hybrid

Satellite photograph data with road maps added. Road and feature labels are also visible.

Satellite

Satellite photograph data. Road and feature labels are not visible.

Terrain

Topographic data. The map includes colors, contour lines and labels, and perspective shading. Some roads and
labels are also visible.

None

No tiles. The map will be rendered as an empty grid with no tiles loaded.

OTHER STYLE OPTIONS

Indoor Maps

At high zoom levels, the map will show floor plans for indoor spaces. These are called indoor maps and are displayed only for the ‘normal’ and ‘satellite’ map types.

to enable or disable indoor maps, this is how it’s done:

We can add custom styles to maps.

In onMapReady method add the following code snippet

under res folder create a folder name raw and add the styles.json file. Sample style.json file

To generate styles json file click this link

Here have some Google map examples. Which is needed in our projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

thirteen + fourteen =

Comment moderation is enabled. Your comment may take some time to appear.