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
on
Adds an event listener to the Map object. The listener will fire every time the event occurs.
Parameters
Name | Required | Description |
---|---|---|
type | Yes | The type (name) of the event for which to listen. |
fn | Yes | The function to run when the event is fired. This function will be passed an object containing the event results. The properties of this object will depend on the event that was fired. |
Example
var map = new Mapzania.Map("map-div", "WORLD", function(){
map.on("streets_layer_changed", function (data) {
console.log(data);
});
map.usingLayer("STREETS)
.filterByText("StreetType=='HIGHWAY'")
.update();
});