I have an google-maps_pin.svg
file which represents a google-maps pin.
I would like to color the different markers (generated with v-for) based on categories (restaurant, art gallery, etc.) dynamically.
Is there a way to achieve that with vue2 leaflet?
Here's my map:
<l-map
style="z-index: 0"
ref="mapRef"
:zoom="zoom"
:center="center"
@update:zoom="zoomUpdated"
@update:center="centerUpdated"
@update:bounds="boundsUpdated">
<l-tile-layer :url="url"></l-tile-layer>
<l-marker
v-for="(markedLocation, index) in marker"
:key="'marker-' + index"
:lat-lng="markedLocation.location"
:icon-url="require('@/assets/googlemaps_markers/google-maps_pin.svg')">
</l-marker>
</l-map>
The color I want to give to the individual pins is stored in markedLocation.info.category.color
variable.