How to provide the ability for your users to select a background map
Icon Map Pro comes with a range of available background styles included. Sometimes you may want to provide the ability for the end-users of your report to select the style themselves.
Icon Map Pro doesn't yet include a menu as part of the user interface, but we can use a slicer visual in Power BI to provide the selection, and pass the selected style through to Icon Map Pro.
You'll notice that the Icon Map Pro style dropdown doesn't have a conditional formatting "fx" button so we can't assign the selected style here. Instead we need to change the Map Source to be "Vector Tiles" and use the "fx" button against "URL of the style JSON file".
Whilst we could manually provide a list of URLs, we can use Icon Map Pro's styles API and request the available styles and their associated URLs from https://styles.iconmappro.com/styles/styles.json
This is a JSON file that we can load into a table in our Power BI report. If you filter the results to include only those of type "background" then these should all work as background maps. You may also wish to filter out those with "(GB only)" in the name if your data extends beyond Great Britain.
Once loaded in, we can simply assign the styles.name field to a slicer. I recommend setting the slicer to be "Single select".
Then in the Icon Map Pro Vector Tiles URL setting, we can assign the styles.url field.
The background style selection will now be based on the selected item in the slicer.
You can download a sample Power BI file to see this in action.