how to add text for display on map to a geojson object in leaflet

后端 未结 3 1888
孤独总比滥情好
孤独总比滥情好 2021-02-02 14:17

So I have a geojson layer in leaflet, and I can add geojson objects to this layer for display on the resulting map.

Now I\'d like to add a text label to display near the

3条回答
  •  鱼传尺愫
    2021-02-02 14:37

    I was looking for the same question recently and just implemented it yesterday based on a posting in the google group. https://groups.google.com/forum/#!topic/leaflet-js/sA2HnU5W9Fw

    Thanks to Adrian for the original code sample.

    Here's the solution:

    Extend the following class as below:

    
    

    Furthermore add this css:

    
    

    And then display the text labels as below:

    
    

    Result:

    enter image description here

提交回复
热议问题