Polygon

Fill colors the area within given vertices

Polygon

Creates a custom polygon. Takes JSON Array of at least 3 latitude/longitude for vertices, color, and transparency as arguments.

new fatosmap.maps.Polygon({ option });

Parameter

Example

let triangleCoords = [    
    {lat: 25.774, lng: -80.190},    
    {lat: 18.466, lng: -66.118},    
    {lat: 32.321, lng: -64.757},    
    {lat: 25.774, lng: -80.190}    
];    

let polygons = new fatosmap.maps.Polygon({    
    paths:             triangleCoords,    
    fillColor:         '#FF0000',    
    fillOpacity:       0.35,
    outlineColor:      '#DC151A',
    text:              'FATOS',
    textColor:         '#91FF7C',
    textSize:          25,
    textOffset:        [5,4],
    textHaloWidth:     10    
});    

bermudaTriangle.setMap(mapInstance);

How to remove polygons

Clears the polygon drawn on the map

Example

// Method 1.
bermudaTriangle.setMap(null);

// Method 2.
polygon.setMap("removeAll");

setVisible

Sets a visibility option for a polygon instance.

Example

polygon.setVisible("none");

Last updated