JS API
- Parameters
- Options
- Example
- Methods
- fitToBoundingBox
- getBoundingBox
- getInitialBoundingBox
- getLayers
- getMouseMode
- off
- on
- once
- refresh
- reset
- setMouseMode
- usingLayer
- usingNewLayer
- Events
- Parameters
- Example
- Methods
- addFeature
- addFeatureCollection
- bringForwards
- bufferGeometry
- changeProperties
- clearFilters
- clearFeatures
- clearStyle
- clipByFeatureCollection
- convertToCentroids
- filterByBoundingBox
- filterByFeatureCollection
- filterByNearest
- filterByText
- getFeatureCollection
- hide
- sendBackwards
- show
- style
- update
- usingFeature
drawing_done
Fired when the user completes a drawing action on the map.
Event Result
GeoJSON Geometry based on the current MouseMode as per the table below:
MouseMode | Result Type |
---|---|
DrawPoint | GeoJSON Point |
DrawLine | GeoJSON LineString |
DrawPolygon | GeoJSON Polygon |
Example
var map = new Mapzania.Map("map-div", "LONDON", function () {
map.on("drawing_done", function (data) {
console.log(data);
});
map.setMouseMode(Mapzania.MouseModes.DrawLine);
});