Skip to main content

Pinning ⭐

Pinning ⭐

When dragging a vertex/marker, you can pin all other Markers/Vertices that have the same latlng to the dragged marker. Exclusive for Leaflet-Geoman Pro ⭐

Pinning Option

Configuration

Pinning is disabled by default. You can enable pinning by setting pinning to true in the global options.

map.pm.setGlobalOptions({ 
pinning: true,
});

You can get the current pinning status by calling map.pm.getGlobalOptions().pinning.

or by destructuring the pinning property from the global options.

const { pinning } = this.map.pm.getGlobalOptions()

Pinning Button in the Toolbar

You can also enable/disable a button in the toolbar to toggle pinning. You can enable (disable) it by setting pinningOption to true (false) in the addControls options.

map.pm.addControls({ 
pinningOption: true,
});

Example

Editing with Pinning enabled (try dragging the intersecting markers):

Loading...

Same example with Pinning disabled:

Loading...