mapbox data markers

Solutions on MaxInterview for mapbox data markers by the best coders in the world

showing results for - "mapbox data markers"
Greta
23 Feb 2018
1// add markers to map
2geojson.features.forEach(function(marker) {
3
4  // create a HTML element for each feature
5  var el = document.createElement('div');
6  el.className = 'marker';
7
8  // make a marker for each feature and add to the map
9  new mapboxgl.Marker(el)
10    .setLngLat(marker.geometry.coordinates)
11    .addTo(map);
12});
13