Options
Options
You have many options available when drawing and editing your layers (described above).
You can set the options per layer as described above, or you can set them globally for all layers. This is especially useful when you use the toolbar and can't change the options programmatically.
Examples:
layer.pm.enable({ pinning: true, snappable: false });
map.pm.setGlobalOptions({ pinning: true, snappable: false });
The following options are additionally to the Draw and Edit Mode options.
Option | Default | Description |
---|---|---|
snappingOrder | Array | Prioritize the order of snapping. Default: ['Marker','CircleMarker','Circle','Line','Polygon','Rectangle'] . |
layerGroup | map | add the created layers to a layergroup instead to the map. |
panes | Object | Defines in which panes the layers and helper vertices are created. Default: { vertexPane: 'markerPane', layerPane: 'overlayPane', markerPane: 'markerPane' } . |
cutAsCircle | false | Enable cutting in shape form of a Circle. |
The following events are available on a map instance:
Event | Params | Description | Output |
---|---|---|---|
pm:globaloptionschanged | e | Fired when global options are changed. |
Some details about a few more powerful options: