This project is read-only.

clear markers via javascript? and save added marker

Apr 2, 2008 at 12:38 AM
any way to clear markers via javascript?
Apr 2, 2008 at 3:42 AM
when the marker collection is empty, when the map is in an updatepanel, when adding it via clientside
Apr 2, 2008 at 6: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 7: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 2: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 6:54 AM
I have to check out that and fix it, if any bug.

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