Mapbox Marker Symbol with Three Digits

萝らか妹 提交于 2020-01-03 15:51:28

问题


I'm trying to label the standard Mapbox markers with two- and three-digit ids using 'marker-symbol'. The two-digit markers work well, as seen below, but when I try to include three digits, i.e. 112, the markers do not display on the map. Is there an easy way to do this with the built-in marker and not creating a custom div marker?


回答1:


Sorry to say, there is no easy way to do this. Not with the built-in marker. Those markers are just images which get loaded from the Mapbox server. They exist up to number 99. Number 100 does not exist, you can check for yourself:

pin-m-99+AA0000.png: https://api.tiles.mapbox.com/v4/marker/pin-m-99+AA0000.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q

pin-m-100+AA0000.png: https://api.tiles.mapbox.com/v4/marker/pin-m-100+AA0000.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q



来源:https://stackoverflow.com/questions/28507910/mapbox-marker-symbol-with-three-digits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!