map.addCircleSync()

April 20, 2018 ยท View on GitHub

The map.addCircle() method adds a circle onto the map synchronously.

let circle: Circle = map.addCircleSync(options);

Parameters

nametypedescription
optionsCircleOptionscircle options

Return value

:arrow_right: Returns Circle


Demo code

<div class="map" id="map_canvas"></div>
map: GoogleMap;

loadMap() {
  let GOOGLE: ILatLng = {"lat" : 37.422858, "lng" : -122.085065};
  this.map = GoogleMaps.create('map_canvas');

  // Add circle
  let circle: Circle = this.map.addCircle({
    'center': GOOGLE,
    'radius': 300,
    'strokeColor' : '#AA00FF',
    'strokeWidth': 5,
    'fillColor' : '#880000'
  });

  // Fit the map camera to circle
  this.map.moveCamera({
    target: circle.getBounds()
  });
}