I am using the last version of GoogleMaps.Subgurim.NET dll in a C# web forms project. I was wondering how it was possible to obtain the effect of the clearOverlays() method of Google Maps v2, in v3, using that component. Let me give you an example; on the map click event I used to delete all the existing markers and then place a new one with an InfoWindow:
protected string GMap1_Click(object s, GAjaxServerEventArgs e)
{
GMarker marker = new GMarker(e.point);
string strInfoWindow = string.Format(
@"<b>Mytext<br> "lat = {0}<br/>lng = {1}",
e.point.lat,
e.point.lng);
GInfoWindow window = new GInfoWindow(marker,
strInfoWindow,
true);
return
e.map+".clearOverlays();"+
window.ToString(e.map);
}
The only parts of the code that have to be noted are the three last lines. Could you please tell me how to change my javascript code in this scenario in order to delete all the markers ?
Thank you in advance for any help. Newcomsas