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
createPolygon
Creates a GeoJSON Polygon geometry object.
Parameters
Name | Required | Description |
---|---|---|
coordinates | Yes | The GeoJSON coordinates of the Polygon or a bounding box coordinate array. |
Example
var gjson = Mapzania.GeoJson.createPolygon([[[20.33, 30.64],[16.23, 21.59],[20.33, 30.64]],[[12.43, 41.22],[19.87, 32.43],[12.43, 41.22]]]);
var gjson = Mapzania.GeoJson.createPolygon([12.1, 3.4, 14.3, 4.2]);