PolygonOptions | MapGL | 2GIS Documentation

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].

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 zoom level.

undefinednumber

Minimum display zoom level.

undefinedstring

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

undefinednumber

Stroke width in pixels.

undefinednumber

Draw order.