The MapKmlLayer
component wraps the google.maps.KmlLayer
class from the Google Maps JavaScript API.
// google-maps-demo.component.ts
import {Component} from '@angular/core';
import {GoogleMap, MapKmlLayer} from '@angular/google-maps';
@Component({
selector: 'google-map-demo',
templateUrl: 'google-map-demo.html',
imports: [GoogleMap, MapKmlLayer],
})
export class GoogleMapDemo {
center: google.maps.LatLngLiteral = {lat: 24, lng: 12};
zoom = 4;
kmlUrl = 'https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml';
}
<!-- google-maps-demo.component.html -->
<google-map height="400px" width="750px" [center]="center" [zoom]="zoom">
<map-kml-layer [url]="kmlUrl" />
</google-map>