Circle

Circle(circle)

Description

Create a circle by entering a center point, radius, colors and transparency.
Radius values is in M(Meter)

Parameter

circle : object

Name Description Parameter Optional
center Set the latitude. number must
radius specifies the Radius of the circle in M(Meter). number must
fillColor specifies a hexadecimal HTML color of the format "#FFFFFF".
The Circle class does not support named colors.
hex optional
Default '#000000'(black)
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. number optional
Default 1.0

Example

let citymap = {
    chicago: {
        center: {lat: 37.5650745, lng: 126.9850103},
        population: 2714856
    }
}
let cityCircle = new fatosmap.maps.Circle({
    fillColor: '#FF0000',
    fillOpacity: 0.35,
    map: mapInstance,
    center: citymap['chicago'].center,
    radius: Math.sqrt(citymap['chicago'].population) * 100
});

cityCircle.setMap(mapInstance)

removeCircle(null)

Description

Clears the circle drawn on the map.

Example

cityCircle.setMap(null)