Mappls offers a variety of preset map styles for rendering your maps. To use these styles, you need to retrieve the list of available styles associated with your account. The listing API helps you both render a specific style and easily switch between different style themes.
From the reference code below, it’s clear that you specify style names, not URLs, when applying styles. Every account starts with a default style to get you up and running quickly.
For a complete list of available styles or further assistance, please contact apisupport@mappls.com.
Explore different map styles Mappls offer Live Demo
To get the list of available styles:
val styleList = mapplsMap.mapplsAvailableStylesList<MapplsStyle> styleList = mapplsMap.getMapplsAvailableStyles();MapplsStyle contains below parameters:
displayName(string): Generic Name of style mostly used in Mappls content.imageUrl(String): Preview Image of stylename(String): Name of style used to change the style.
To set Mappls Maps style reference code is below:
mapplsMap.setMapplsStyle(style, object : OnStyleLoadListener {
override fun onError(p0: String?) {
}
override fun onStyleLoaded(style: Style) {
}
})
//OR
mapplsMap.setMapplsStyle(name)mapplsMap.setMapplsStyle(name, new OnStyleLoadListener() {
@Override
public void onError(String error) {
}
@Override
public void onStyleLoaded(Style styles) {
} });
//OR
mapplsMap.setMapplsStyle(name); To enable/disable loading of last selected style:
MapplsMapConfiguration.getInstance().isShowLastSelectedStyle = false //true is enable & false is disable(default value is true)MapplsMapConfiguration.getInstance().setShowLastSelectedStyle(false); //true is enable & false is disable(default value is true) To get the current style name in use:
val mapplsStyle = mapplsMap.style?.mapplsStyleString mapplsStyle = mapplsMap.getStyle().getMapplsStyle(); For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!
