我正在尝试从主网站上实例化一个angular-google-maps示例:https://angular-maps.com/guides/getting-started/来对应用程序进行一些测试.
我使用了他们的示例代码,如下所示:
import { Component } from '@angular/core';
@Component({
selector: 'page-location',
templateUrl: 'location.html',
})
export class LocationPage {
title: string = 'My first AGM project';
lat: number = 51.678418;
lng: number = 7.809007;
}
page-location
{
agm-map {
height: 150px;
}
}
<h1>{{ title }}</h1>
<!-- this creates a google map on the page with the given lat/lng from -->
<!-- the component as the initial center of the map: -->
<agm-map style="height: 300px;" [latitude]="lat" [longitude]="lng"> …Run Code Online (Sandbox Code Playgroud)