AI-generated Key Takeaways
-
MapStyleOptions
allows customization of Google Maps styles, impacting the visual display of features like roads and parks. -
You can change the style of map features or hide them completely to emphasize specific elements or complement your app's content.
-
Style options are defined using a JSON string, which can be loaded from a raw resource or directly passed as a string.
-
loadRawResourceStyle
and the constructor are the primary methods to createMapStyleOptions
instances.
Defines styling options for a GoogleMap
.
With style options you can customize the presentation of the standard Google map styles, changing the visual display of features like roads, parks, and other points of interest. As well as changing the style of these features, you can also hide features entirely. This means that you can emphasize particular components of the map or make the map complement the content of your app.
Developer Guide
For more information, read the developer guide.
Inherited Constant Summary
Public Constructor Summary
MapStyleOptions(String json)
Creates a new set of map style options based on the given JSON styling string.
|
Public Method Summary
static MapStyleOptions |
loadRawResourceStyle(Context
clientContext, int resourceId)
Creates a new set of map style options based on the a JSON styling string
loaded from a raw resource identifier.
|
void |
writeToParcel(Parcel out, int
flags)
|
Inherited Method Summary
Public Constructors
public MapStyleOptions (String json)
Creates a new set of map style options based on the given JSON styling string.
Parameters
json | The JSON string containing map style options. Must not be
null . |
---|
Public Methods
public static MapStyleOptions loadRawResourceStyle (Context clientContext, int resourceId)
Creates a new set of map style options based on the a JSON styling string loaded from a raw resource identifier.
Parameters
clientContext | Client context for the supplied resourceId. |
---|---|
resourceId | Id of a raw resource containing the styling JSON. |
Returns
- A reference to this MapStyleOptions to allow call chaining.
Throws
if resourceId is not a valid raw resource id or the resource could not be read. | |
Resources.NotFoundException |