PolygonOptions | MapGL | 2GIS Documentation
MapGL JS API

PolygonOptions

Polygon initialization options.

Properties
undefinedstring

Fill color in hexadecimal RGB (#ff0000) or RGBA (#ff0000ff) format.

number[][][]

Geographical coordinates of polygon points in format: [outerEdges, cropEdges1, cropEdges2, ...].

The first section is outerEdges which describes an array of outer edges: [firstPoint, secondPoint, ..., firstPoint]. Each point is a geographical point: [longitude, latitude]. The last point should be the same as the first.

Then optionally you can crop some polygons from the main one (outer) by specifying cropEdges1, cropEdges2 and so on. A format is the same as the main section: [firstPoint, secondPoint, ..., firstPoint] each point is [longitude, latitude].

Important: outerEdges and cropEdgesN must not touch or intersect each other.

Only the first section (outerEdges) is required. There may be many cropEdges sections.

undefinedfalsetrue

Allows the polygon to emit events (like mouseover). true by default.

undefinednumber

Maximum display styleZoom.

undefinednumber

Minimum display styleZoom.

undefinedstring

Stroke color in hexadecimal RGB (#ff0000) or RGBA (#ff0000ff) format.

undefinednumber

Stroke width in pixels.

any

User specific data.

undefinednumber

Draw order.