Creates a JavaScript command as a String that, when executed on the client, removes all overlays from the map.

Namespace: Reimers.Google.Map
Assembly: Reimers.Google.Map (in Reimers.Google.Map.dll) Version: (


public string ClearOverlays()

Return Value

A JavaScript command as a String.


This method creates a JavaScript command that must be sent to a method that executes it. Merely executing the method does not produce any results.


The following code shows how the ClearOverlays() method can be used in a ZoomChanged event handler to clear the map (in preparation for loading another set of overlays). Note the code does not persist the state of the control and the overlays will still be available on the serverside collection.

void Map_ZoomChanged(object sender, ZoomEventArgs e)
    e.MapCommand = e.Map.ClearOverlays();

See Also