Polygon | MapGL | Urbi Documentation
MapGL JS API

Polygon

Class for creating a polygon on the map

new constructor(map, options)

Example:

const polygon = new mapgl.Polygon(map, {
    coordinates: [
        [
            [82.878543, 54.975937],
            [82.903049, 54.981333],
            [82.929373, 54.973391],
            [82.902421, 54.996199],
            [82.878543, 54.975937],
        ],
        [
            [82.908136, 54.987526],
            [82.899028, 54.983494],
            [82.897673, 54.988904],
            [82.908136, 54.987526],
        ],
    ],
    color: '#990000',
    strokeColor: '#bb0000',
});
Parameters
map
Map

The map instance

options
PolygonOptions

Polygon options

Returns
Methods