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
style
Sets the style of the single feature.
Parameters
Name | Required | Description |
---|---|---|
style | Yes | An object defining the style. All properties are optional and may be left out. - fillColor (The fill color of the feature) - strokeColor (The stroke color of the feature) - strokeWidth (The width of the stroke of the feature) - size (Applies to point layers and is the diameter of the point) |
Example
var map = new Mapzania.Map("map-div", "AFRICA", function () {
map.usingLayer("COUNTRIES")
.usingFeature("107")
.style({ fillColor: "#FF0000"})
.update();