Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mapbox remove marker

// markers saved here
var currentMarkers=[];

// tmp marker
var oneMarker= new mapboxgl.Marker(currentMarkerDiv)
    .setLngLat(marker.geometry.coordinates)
    .addTo(mapboxMap);

// save tmp marker into currentMarkers
currentMarkers.push(oneMarker);


// remove markers 
if (currentMarkers!==null) {
    for (var i = currentMarkers.length - 1; i >= 0; i--) {
      currentMarkers[i].remove();
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to add Strings as numbers in JavaScript 
Javascript :: detect click outside react component 
Javascript :: plotly react 
Javascript :: javascript separate string by character 
Javascript :: how to make fake binary 
Javascript :: react native red triangle up 
Javascript :: log odd numbers js 
Javascript :: print element by xpath javascript 
Javascript :: switch alert 
Javascript :: react webpack.config.js example 
Javascript :: dropify use 
Javascript :: Difference in push and navigate in react Navigation 
Javascript :: javascript MIN_VALUE 
Javascript :: Node Sass version 7.0.0 is incompatible with ^4.0.0 
Javascript :: mui date picker width 
Javascript :: hash object javascript 
Javascript :: console shortcut chrome 
Javascript :: remove duplicate value from array 
Javascript :: Web History API 
Javascript :: momentjs german date format 
Javascript :: javascript get string from array with space between 
Javascript :: clear element children js 
Javascript :: javascript how to take off a decimal 
Javascript :: javascript empty array 
Javascript :: reload datatable 
Javascript :: includes method javascript 
Javascript :: jquery preload images 
Javascript :: fuse.js 
Javascript :: how to get variable value outside function in javascript 
Javascript :: user icon discord js 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =