clear markers via javascript? and save added marker

Apr 1, 2008 at 11:38 PM
any way to clear markers via javascript?
Apr 2, 2008 at 2:42 AM
when the marker collection is empty, when the map is in an updatepanel, when adding it via clientside
Apr 2, 2008 at 5:57 AM
Unfortunatly there is no clear method, which should have it.
It will be added in next release.
For the example I made I just set Markers to null.
You can see it in GoogleMap Control 3.2 Sample Website release file - page GoogleMapClientUpdate.aspx.

Apr 2, 2008 at 6:19 AM
For adding a new marker in JS when marker collection is empty you can use the map instrance.
Here is an example of you can add a marker from your JS code:
function addMarker() {
    var map = <%= GoogleMap1.ClientMapID %>;
    map.addMarker({Latitude: 42.1229, Longitude: 24.7879});

As you can see you can use addMarker and pass an JS array map of the properties for the marker.
The properties' names are same like in the GoogleMarker (see GoogleMarker.cs).

Apr 2, 2008 at 1:49 PM
i followed that example, but the collection was empty on the postback/callback.

maybe because my map is in an updatepanel

will test more
Apr 3, 2008 at 5:54 AM
I have to check out that and fix it, if any bug.

Jul 7, 2008 at 9:13 PM
Markers are gone in FireFox after postback , is there any solution ?