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
usingLayer
Get a Layer Object from the map based on the key parameter.
This layer object is a fluent object and can be used to chain method calls to the layer as per the example below.
Parameters
Name | Required | Description |
---|---|---|
key | Yes | The key for the layer that will be used. |
Example
var map = new Mapzania.Map("map-div", "AFRICA", function () {
map.usingLayer("REGIONS")
.hide();
map.usingLayer("COUNTRIES")
.filterByText("LandLocked=='Y'")
.convertToCentroids()
.style({ fillColor: "#0000FF"})
.update();
});