return type jQuery collection
syntax .geomap( "empty" [ , Boolean refresh ] )
$( map or service selector ).geomap( "empty" )
$( map or service selector ).geomap( "empty", false )

The empty method removes all shapes previously added with the append method.

The jQuery UI widget factory returns the original jQuery collection to maintain call chaining.

delaying refresh

The optional refresh argument determines if geomap refreshes the map graphics after this call to empty. It defaults to true. If you pass false, geomap will remove all shapes internally but not immediately redraw the graphics. The changes will display if the user moves the map or you call geomap's refresh method.

service-level shapes

Similar to how you can remove shapes from specific services, you can empty specific services of all shapes as well.

You do this by targeting a service inside a map instead of the map itself for your call to geomap's empty method. For example, the default map service has the CSS class: osm. We can remove all shapes from that service specifically by using jQuery to target the service:

$( "#map .osm" ).geomap( "empty" );

Calling empty on the map widget will not remove shapes that have been appended to services.

To remove all shapes from the map and all services, you can use the comma selector and the built-in geo-service CSS class:

// empty the map widget and any services
$( "#map,#map .geo-service" ).geomap( "empty" );