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: 5.3.95.699 (5.3.95.699)

Syntax

C#
public string ClearOverlays()

Return Value

A JavaScript command as a String.

Remarks

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.

Examples

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.

CopyC#
void Map_ZoomChanged(object sender, ZoomEventArgs e)
{
    e.MapCommand = e.Map.ClearOverlays();
}

See Also