Custom Map Box Navigation Controls
✓ Published0🌍 Public
Aalassetter
Last edited Jul 2, 2018
Created on Jul 2, 2018
This example shows custom-styled navigation controls for a Mapbox GL map, replacing the default icons with 30x30 SVG graphics for zoom in, zoom out, compass, and fullscreen actions. The code uses Mapbox GL JS’s `NavigationControl` and `FullscreenControl` APIs to position the buttons in the top-right and bottom-right corners. It embeds optimized SVG data URIs directly into CSS classes like `.mapboxgl-ctrl-zoom-in` and `.mapboxgl-ctrl-compass-arrow`, overriding default backgrounds with `!important`. The icons are created in Sketch, exported to SVG, and optimized before being compressed into CSS background images.
AI-generated description