Today let’s talk about how to change the image layout map dynamically.
Let’s imagine that we need to use 2 maps, one for US and another one for CA and you have a country selector that when you change the element to US, you want to see US map and the same for CA.
To do that, you just have to:
- Create a new attribute and add an expression like this: ApplySimple(“case when #0 = ‘US’ then ‘VisFramework/map/us.html’ else ‘VisFramework/map/ca.html’ end”; country_name)
As you can see, we have this applysimple with a case to test when the country is US or CA, then we are adding the string and pointing where are the image maps in Microstrategy Web/Mobile.
Now you have to rename the attribute form to “SHAPEFILE”, like the image below:
2. Save your attribute. Open the document and add that attribute with your desired attribute, like this:
3. Configure it to use the Image Layout Widget:
Now, when you select US or CA in your selector, it will automatically change to the right map.
Hope it helps!
God bless you!