Skip to main content

Set Mappls style

Mappls offers a range of preset styles to rendering the map. The user has to retrieve a list of styles for a specific account. The listing api would help in rendering specific style as well as facilitate the switching of style themes.

From the below reference code it would become quite clear that user has to specify style names and not URLs to use them.

You can get your api key to be used in this document here: https://apis.mappls.com/console/

A default style is set for all account users to start with. To know more about available styles, kindly contact apisupport@mapmyindia.com

This feature is available from version v2.0

List of Available Styles

To get the list of available styles :

Method:

mappls.getStyles();

Click for Live Demo: https://about.mappls.com/api/web-sdk/vector-map-example/Maps/mappls-map-style

Mappls Map Styles contains below parameters:

  1. description(String): Description of the style
  2. displayName(string): Generic Name of style mostly used in Mappls content.
  3. imageUrl(String): Preview Image of style
  4. name(String): Name of style used to change the style.

Set Mappls Styles

To set the Mappls style refer the code below :

Method:

mappls.setStyles();

For eg:

mappls.setStyle(‘grey-day’);