问题
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