basemaptoggler
This bundle provides a widget for toggling between available basemaps.
The widget is registered at the component system with the widget role dropDownBaseMapToggler
.
Usage
This bundle requires basemaps to be configured (for details about how to configure basemaps, see the map-init bundle).
Custom icon styles
It is possible to define custom styles for specific basemap entries within the basemaptoggler menu.
"map-init": {
"Config": {
"basemaps": [
{
"id": "esri_satellite",
"basemap": "satellite",
"title": "Satellit",
"description": "This basemap is provided by a well known Esri basemap ID"
}
]
}
}
Use itemStyles
to map CSS classes to an ID of your basemaps:
"basemaptoggler": {
"Config": {
"itemStyles": {
// short form to select a custom icon class
"esri_satellite": "icon-house",
// use following form to use custom base class on the menu entry
"esri_satellite": {
// custom class on menu root node
"baseClass": "my-custom-css-class",
// custom class on icon node
"iconClass": "icon-house"
}
}
}
}
Use thumbnail images as preview icons
It is possible to use thumbnail images instead of custom icons. You can define a custom image by using the property
thumbnailUrl
in the map-init bundle documentation.
To enable the thumbnail icons it is required to define the icon class 'icon-thumbnail'. Configure itemStyles
with
icon-thumbnail
to enable the displaying of the thumbnail images:
"basemaptoggler": {
"Config": {
"itemStyles": {
"esri_satellite": "icon-thumbnail"
}
}
}