Remove specific marker
See original GitHub issueHello I need to update a marker position, but i cant, this is my code. I`ve tried to put marker.remove() instruction but nothing happens.
$(".startButton").click(function(){
/*
marker_tipe_a.remove(); // I need a function like this:
marker.remove(); // Nothing happens
map.marker.remove(); //nothing happens
*/
map.getCameraPosition(function(camera){
map.addMarker({
'position': new plugin.google.maps.LatLng(camera.target.lat,camera.target.lng),
'icon': 'www/img/start.png'
}, function(marker) {
});
});
})
$(".endButton").click(function(){
map.marker.remove();
})
Please help
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Google Maps Api 3 Remove Selected Marker Only
To remove particular Marker,Find that Element Index using Unique Id for Each Marker. var MarkerIndex = MarkerArray.findIndex(function GetIndex( ...
Read more >Removing Markers | Maps JavaScript API - Google Developers
This example creates a map where each click by the user creates a marker. Click the buttons to hide or delete all of...
Read more >Google Maps V3 - Remove single marker - ASPSnippets
In this short article I will explain how to remove specific / single / selected marker on Button click in Google Maps V3....
Read more >How to Remove Markers From Google Maps
Click the marker to reveal the editing options. Click the "Delete" link in the lower-left corner of the dialog box.
Read more >Removing individual markers from map - GIS Stack Exchange
I couldn't get the layer to be removed, here are some solutions for how to remove individual markers. Share. Share a link to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i too have the same problem. the following are properties of the class,
markers = [{lat:40.730610,lng: -73.935242,title:'marker 1'},{lat:35.5175,lng: 86.5804,title:'marker 2'}];
arrayMarkers:Marker[];
and the following are the methods of the class,
and
the addMarkers method working and add markers on map. But, the removeMarkers method not seems to remove the markers.
Set my location to true on the map e.g. GoogleMaps.create(‘map_canvas’,{ controls:{ myLocation:true } }