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
Adds a style to a layer. This style will replace any styles that have already been applied using this method and will supercede any styles that have been configured by the MapStyler.
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", "WORLD");
map.usingLayer("COUNTRIES")
.style({ fillColor: "#0000FF"})
.update();