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
setMouseMode
Sets the map mode which determines the behaviour of the map based on mouse activity. Examples of this behaviour include zooming, panning and drawing on the map.
When this method is called it fires the mouse_mode_set event.
Parameters
Name | Required | Description |
---|---|---|
mode | Yes | The mouse mode that you want the map to be in. Valid options are: -Mapzania.MouseModes.Pan (default) -Mapzania.MouseModes.DrawPoint -Mapzania.MouseModes.DrawLine -Mapzania.MouseModes.DrawPolygon NOTE: The last three modes fire the drawing_done event when completed. See manual for more details. |
Example
var map = new Mapzania.Map("map-div", "WORLD");
map.setMouseMode(Mapzania.MouseModes.DrawPoint);