Page 1 of 1

How to clear the google map markers before refreshing with a new map?

Posted: Wed Mar 12, 2014 7:35 am
by Erwin Oliva

Hello, Could someone be kind enough to share how I can clear the markers in google map before refreshing it with a new set of markers?

I have followed the tutorial in http://docs.appery.io/tutorials/addin... and I can get markers on the map. However, I have added the capability to add new set of markers, but I want to clear the previous markers before showing the new set.

Thank you for your kind help.


How to clear the google map markers before refreshing with a new map?

Posted: Wed Mar 12, 2014 9:17 am
by Maryna Brodina

Hello!

If you were following this tutorial http://docs.appery.io/tutorials/addin... every time map is refreshed - see lineprevar map = new google.maps.Map(document.getElementsByName("multiGoogleMap")[0],...../preand all markers are created from scratch. To avoid shoving old markers refresh array locationHelper.aLocations prelocationHelper.aLocations = [];/pre


How to clear the google map markers before refreshing with a new map?

Posted: Wed Mar 12, 2014 11:21 pm
by Erwin Oliva

Thank you very much Maryna! It helped.


How to clear the google map markers before refreshing with a new map?

Posted: Wed Jul 16, 2014 6:46 am
by adith visnu

Hello Maryna!

your answer was for clear markers where location saved in array, but how to clear map marker on object in different function?


How to clear the google map markers before refreshing with a new map?

Posted: Wed Jul 16, 2014 9:09 pm
by Kateryna Grynko

Hi Adith,

Take a look here please:
https://developers.google.com/maps/do...


How to clear the google map markers before refreshing with a new map?

Posted: Wed Jul 16, 2014 9:11 pm
by Kateryna Grynko

Hi Adith,

Take a look here please:
https://developers.google.com/maps/do...