Dynamic Images for Map Markers - Maps Marketplace Widget

0
Hi Forum,   I am trying to fix a feature that was previously working on a maps implementation that was built in mendix 7.   The implementation uses the Maps widget published by Mendix with open street maps as the map provider.  The feature was to show different colored marker pins based on an enumeration value of the objects being passed into a marker list in the map widget. This all previously worked but we have since upgraded our app to Mendix 9 and also updated all relevant widgets(including Maps) for compatibility purposes.  I didn’t realize that the enumeration image marker feature was sunsetted after version 2.0 of the Maps widget(specified here in the documentation).   Is there no longer any way to pass an image to be used for the map marker on a per object basis?  Any input or alternate solution ideas would be appreciated! Thanks Danny
asked
4 answers
1

Hi Danny,

 

Have look into the blog about Leaflet Js hope this will be helpful for you.

https://medium.com/mendix/map-customizations-in-mendix-using-leaflet-part-2-bea0d1187be4

answered
0

Hi Danny,

 

I have the same problem and still could not solve it. Did you apply the suggestion provided by Javith?

 

Thanks.

answered
0

For anyone who may find this post here is what I did to solve this issue.

The solution doesn’t account for completely dynamic images because it requires all images to have their own line-item in the marker list.
 

I ended up adding a line item to the marker list for every Image that we required to be on our map.  Each line item’s visualization was set to a static image.  Then the datasource on each Marker list item was set to filter by xpath based off of an enumeration value that corresponded to to the specific image on the the Marker list item.

This solution allowed us to set the marker image for each data item to show up on the map with.  However, if we ever need to add any new images it requires that we add a value to the enumeration, add a new image to an image collection in Studio Pro, and add a new Marker list item to the map widget.

I still wish that there was an easy way to pull a dynamic image to display on the map as it would be much more maintainable and make the widget more capable.

answered
0

I think there is a bug in the map component when using Dynamic Images.

Dynamic Images want a context, an object that has a reference to an Image entity.

Therefore Dynamic Images only work in a Data Container.  However a Map View is not considered a Data Container (despite that it has a data source) and therefore you cannot select a related Dynamic Image as marker.

answered