API DOCUMENTATION

Polygon
Create a custom polygon to enter coordinate values(at least 3 points), colors and transparency.

new fatosmap.maps.Polygon({ option })

Parameter : Polygon

Required Parameter Description
paths Set an array of coordinate objects
[{lat: ,lng: },{lat: lng: },,,,,]

Optional Parameter Description
fillColor specifies a hexadecimal HTML color of the format "#FFFFFF".
The Polygon class does not support named colors.Default is '#000000'
fillOpacity specifies a numerical value between 0.0 and 1.0 to determine the opacity of the fill's color. The default is 1.0
outlineColor specifies a hexadecimal HTML outline color of the format "#FFFFFF".
The Polygon class does not support named colors.Default is '#000000'
text Optional formatted. Defaults to "
textColor Optional color. Defaults to "#000000". Requires text option.
textHaloColor Optional color. Defaults to "rgba(0, 0, 0, 0)". Requires text option.
textHaloWidth Optional number greater than or equal to 0. Units in pixels. Defaults to 0. Requires text option.
textSize Optional number greater than or equal to 0. Units in pixels. Defaults to 16. Requires text option.
textOffset Optional array of numbers. Units in ems. Defaults to [0,0]. Requires text option.

[ example : Polygon ]

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);

removePolygon
Clears the polygon drawn on the map.

 

[ example ] 
bermudaTriangle.setMap(null)

removeAllPolygon
Clears the all polygon drawn on the map.

 

[ example ] 

polygon.setMap(‘removeAll’)

visibility 

Optional enum. One of “visible”, “none”. Defaults to “visible”.

 

[ example ] 

polygon.setVisible(‘none’)