Change color of leaflet marker

后端 未结 5 1277
甜味超标
甜味超标 2020-12-05 08:15

Is there anyway to change the color of leaflet marker base on the value of some variable. In the following map, for example, I wish to assign marker color based on mag varia

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 08:40

    L.Marker uses images (one for the marker, one for the shadow) so that's not possible. You can however use your own images, there's a good write up on the topic among the tutorials on the Leaflet site:

    http://leafletjs.com/examples/custom-icons.html

提交回复
热议问题