Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 916 Bytes

README.md

File metadata and controls

35 lines (29 loc) · 916 Bytes

MapPolygon

The MapPolygon component wraps the google.maps.Polygon class from the Google Maps JavaScript API.

Example

// google-maps-demo.component.ts
import {Component} from '@angular/core';
import {GoogleMap, MapPolygon} from '@angular/google-maps';

@Component({
  selector: 'google-map-demo',
  templateUrl: 'google-map-demo.html',
  standalone: true,
  imports: [GoogleMap, MapPolygon],
})
export class GoogleMapDemo {
  center: google.maps.LatLngLiteral = {lat: 24, lng: 12};
  zoom = 4;

  vertices: google.maps.LatLngLiteral[] = [
    {lat: 13, lng: 13},
    {lat: -13, lng: 0},
    {lat: 13, lng: -13},
  ];
}
<!-- google-maps-demo.component.html -->
<google-map height="400px" width="750px" [center]="center" [zoom]="zoom">
  <map-polygon [paths]="vertices" />
</google-map>