我尝试将谷歌地图包含在多个位置。
对于一个位置,Iframe 工作正常。我不知道如何在 Iframe 中实现多个位置。所以我尝试了年度股东大会。我也将相同的 APIKey 用于 AGM。但是出现Google Maps JavaScript API 错误: ApiTargetBlockedMapError错误。
这是我的 IFrame 代码
<iframe src="https://www.google.com/maps/embed/v1/place?q=11.0443324,77.04292389999999&key=MY_APIKEY" width="98%" height="100%" frameborder="0"></iframe>
对于 AGM 在 NgModule 中添加密钥
AgmCoreModule.forRoot({AgmCoreModule.forRoot({
apiKey: 'MY_APIKEY',
})
<agm-marker *ngFor="let loc of mSupplierLocationList" [label]="loc.label" [latitude]="loc.latitude" [longitude]="loc.longitude" >
</agm-marker>
</agm-map>
Run Code Online (Sandbox Code Playgroud) javascript google-maps google-maps-api-3 angular-google-maps angular8