Add popups when markers are clicked using Mapbox GL JS.
See the example: https://docs.mapbox.com//help/tutorials/add-points-pt-3/
| <div id="map"></div> | |
Add popups when markers are clicked using Mapbox GL JS.
See the example: https://docs.mapbox.com//help/tutorials/add-points-pt-3/
| mapboxgl.accessToken = 'pk.eyJ1IjoiYWx0ZXJyYW10bmNvIiwiYSI6ImNqY2tycHp5YjFqa2syd25zanliMDhpdGMifQ.HVA2zVCFUVNkJ210dAQEqQ'; | |
| const map = new mapboxgl.Map({ | |
| container: 'map', | |
| style: 'mapbox://styles/alterramtnco/cla02mh52000m14sgckph00xv', | |
| //center: [-119.029853, 37.634088], | |
| //zoom: 10.7 | |
| }); | |
| <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.js"></script> |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| #map { | |
| position: absolute; | |
| top: 0; | |
| bottom: 0; | |
| width: 100%; | |
| } | |
| <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.css" rel="stylesheet" /> |