Skip to main content

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.

OptionDefaultDescription
snappingOrderArrayPrioritize the order of snapping. Default: ['Marker','CircleMarker','Circle','Line','Polygon','Rectangle'].
layerGroupmapadd the created layers to a layergroup instead to the map.
panesObjectDefines in which panes the layers and helper vertices are created. Default: { vertexPane: 'markerPane', layerPane: 'overlayPane', markerPane: 'markerPane' }.
cutAsCirclefalseEnable cutting in shape form of a Circle.

The following events are available on a map instance:

EventParamsDescriptionOutput
pm:globaloptionschangedeFired when global options are changed.

Some details about a few more powerful options: