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
once
Adds an event listener to the Map object. The listener will fire once and then be disabled.
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");
map.once("roads_layer_queried", function (data) {
console.log(data);
});
var filter = Mapzania.Filters.filterByText("StreetType=='HIGHWAY'");
map.query("STREETS", filter, {
ignoreAppliedFilters: true
});