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
usingMapLayer
Gets a Query Object based on a layer of an existing Map Object.
It is used specifically to run queries based on the layers of an existing Map Object without interfering with the map itself.
This object is a fluent object and can be used to chain method calls to the query as per the example below.
Parameters
Name | Required | Description |
---|---|---|
map | Yes | An existing Map Object |
layerKey | Yes | The key of the layer to be used in the query. |
options | No | An object for custom configuration of the map-layer query. The possible options are shown in the section below. |
Options
Name | Default | Description |
---|---|---|
useFilters | true | If set to true, the query will take into consideration any filters that have been applied to the map layer. |
useState | true | If set to true, the query will take into consideration the state of the map layer. This includes any client-side features that have been added to the layer as well as whether the layer is visible or not. |
Example
var map = new Mapzania.Map("map-div", "LONDON", function () {
var qry = new Mapzania.QueryEngine();
qry.usingMapLayer(map, "WARD", {
useState: false,
useFilters: true
})
.convertToCentroids()
.apply()
.then(function (data) {
console.log(data);
});
});