Leaflet dynamic markers

I have been playing witht Leaflet maps. Everything working, but...
I try to show different markers for different locations from a dbase. Leaflet will show every location when using standard markers. All is hidden when using dynamic markers. Probably doing something wrong, but I can't figure this one out.

I have the same issue, the icon url doesn't seem to have any affect.

Try following update: dmxLeafletMaps.zip (11.8 KB)

1 Like

Thanks @patrick, that fixes the dynamic icon url
Although it appears custom markers are off the location. Instead of using the bottom of the marker to point to the location, its the top

I can't get it working. @mimuk how does your icon url look like?
Where did you place the files in the zip?

They're just in my local assets folder.
e.g. "marker" being my dynamic field.

marker-icon-url="'http://localhost:3000/assets/img/markers/'+marker+'.png'"

@mimuk Thanks for the quick response. Mine is at a live server. Markers are at '''graphics/filename''' so now I still don't know why they don't show since setup is (almost) the same.
I will continue to investigate

Seems using a custom image for a marker is not that simple with leaflet maps, you have to set several options to correctly display them.

Documentation - Leaflet - a JavaScript library for interactive maps (leafletjs.com)

Not sure if we should add all these options or have some predefined icons where you can choose from.

rather than add all of the options for a custom image, maybe select from bootstrap/font awesome icon and colour?

In that case I will stick to the basic markers as provided. Works well too, but so nice as custom markers.