How do you draw a polygon in OpenLayers?

How do you draw a polygon in OpenLayers?

Select a geometry type from the dropdown above to start drawing. To finish drawing, click the last point. To activate freehand drawing for lines, polygons, and circles, hold the Shift key. To remove the last point of a line or polygon, press “Undo”.

What projection does OSM use?

Spherical Pseudo-Mercator projection
Spherical Pseudo-Mercator projection Most of OSM, including the main tiling system, uses a Pseudo-Mercator projection where the Earth is modelized as if it was a perfect a sphere. Combined with the zoom level, the system is known as a Web Mercator on Wikipedia.

OpenLayers. Handler. Polygon Handler to draw a polygon on the map. Polygon is displayed on mouse down, moves on mouse move, and is finished on mouse up. OpenLayers. Handler. Polygon Handler to draw a polygon on the map. {String} Key modifier to trigger hole digitizing.

When do you call the polygon handler in OpenLayers?

Called as each point is added. Receives the new point geometry. Called when the point drawing is finished. The callback will receive a single argument, the polygon geometry. Called when the handler is deactivated while drawing. The cancel callback will receive a geometry.

How do I select a feature in OpenLayers?

When using Single-click or Click you can hold do Shift key to toggle the feature in the selection. Note: when Single-click is used double-clicks won’t select features. This in contrast to Click, where a double-click will both select the feature and zoom the map (because of the DoubleClickZoom interaction).

How to trigger hole digitizing in OpenLayers 2?

{String} Key modifier to trigger hole digitizing. Acceptable values are “altKey”, “shiftKey”, or “ctrlKey”. If not set, no hole digitizing will take place. Default is null. {Boolean} Currently drawing an interior ring.