Friday, February 26, 2021

Adding Markers Inwards Mapbox Gl


I wouldn't usually postal service this map showing the birthplaces of Liverpool Football Club players simply it is the commencement Mapbox GL created map inward the wild that I've seen which includes map markers. The map besides includes text labels amongst the markers as well as thence could furnish a useful origin for anyone looking to add together markers as well as / or text labels to a Mapbox GL map.

The Mapbox GL representative maps includes i demo showing how to add together markers to a map. That example, similar this map, shows you lot how to add together an icon for the marking as well as besides how to add together a text label to the marker. The Mapbox GL representative map besides shows you lot how to fashion the text label. However the Liverpool players map includes far to a greater extent than styling of the text labels than the Mapbox GL example, as well as thence could live on a useful direct for anyone interested inward adding text labels to their markers.

If you lot await at the origin code for the Liverpool players map you lot tin dismiss encounter how a halo is added to the text,

"text-halo-color": "white",
"text-halo-width": 1,
"text-halo-blur": 0.5,

You tin dismiss besides encounter inward this map how you lot tin dismiss command the size of the text label according to the zoom degree of the map. In this representative the text labels drib dead bigger equally you lot zoom inward on the map,

"text-size": { "stops": [[2, 6], [4, 8],[6,10],[8,12],[14,16]]

Currently Mapbox GL doesn't function on Internet Explorer (although Mapbox tell back upwardly for IE is coming soon). While IE isn't supported it is skilful do to add together a warning for IE users. This Liverpool players map doesn't include a warning simply the Mapbox GL examples department does include an representative of how you lot tin dismiss Check for Mapbox GL Browser Support as well as warning users amongst non-supported browsers.

No comments:

Post a Comment