RemoveMarkersRequest RPC
Remove markers from the map.
Description
Markers can be removed from the map by sending a RemoveMarkersRequest. The request can include an ID for removing a single marker or when no ID is provided all markers are cleared.
Parameters
(* means the parameter is required)
Name | Type | Description | Default value |
---|---|---|---|
id | [Parameter type, f.e. "String"] | id for marker to remove, removes all if undefined | undefined |
Examples
Remove single marker:
var sb = Oskari.getSandbox();
var reqBuilder = sb.getRequestBuilder('MapModulePlugin.RemoveMarkersRequest');
if (reqBuilder) {
var request = reqBuilder('my marker id');
sb.request('MainMapModule', request);
}
Clearing all markers:
var sb = Oskari.getSandbox();
var reqBuilder = sb.getRequestBuilder('MapModulePlugin.RemoveMarkersRequest');
if (reqBuilder) {
sb.request('MainMapModule', reqBuilder());
}
Related api
- addMarkerRequest
- afterAddMarkerEvent
- afterRemoveMarkersEvent