generating numbered markers

后端 未结 2 1692
长发绾君心
长发绾君心 2020-12-20 02:08

I am looking for numbered markers. and manually creating marker numbered from 1-1000 is quite laborious.

Is there are better way to upload an image and the program g

相关标签:
2条回答
  • 2020-12-20 02:11

    You can use Dynamic Icons of Google Chart API, and get customized markers for your map.

    You can use for example this pattern for marker's icon:

    https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=*number*|FF776B|000000
    

    and the usage could be this:

    var number = 15; //
    var marker = new google.maps.Marker({  
        position: latlngOfMarker,   
        map: map,  
        icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld='+number+'|FF776B|000000'
    });
    

    The icon will be like this: enter image description here

    However, note that the service is deprecated ,and it will not be suitable for long term projects.

    0 讨论(0)
  • 2020-12-20 02:19

    Here are some options:

    • MarkerWithLabel

    • numbered markers from 0 - 300 (found with a little googling)

    • numbered markers from 0 - 999 (more googling)

    0 讨论(0)
提交回复
热议问题