Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

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

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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

Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

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

Thank you very much Maryna! It helped.

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

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

Hello Maryna!

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

Return to “Issues”