【问题标题】:Angular google maps uploaded KML Layer is not showing up on google map:Angular 谷歌地图上传的 KML 图层未显示在谷歌地图上:
【发布时间】:2019-03-26 15:09:01
【问题描述】:

我在将 KML 上传到 AGM(Angular Google Maps API)时遇到问题。 我已使用 KML 文件的全局 URL 将 KML 图层添加到 AGM-Map。应用程序没有给出任何错误,但 KML 没有显示在谷歌地图上。

我正在使用 Angular 5.2.9 和 "@agm/core": "^1.0.0-beta.3"

下面是代码sn-p。

<agm-map [latitude]="-24" [longitude]="135" [zoom]="5" (mapClick)="placeMarker($event)"  >                      
  <agm-marker [latitude]="r.Latitude" [longitude]="r.Longitude" *ngFor="let r of embargoViewModelListEnable; " [iconUrl]="location.icon"> 
  <agm-info-window>Latitude : {{r.Latitude}}, Longitude : {{r.Longitude}} PostCode :{{r.PostCode}}</agm-info-window></agm-marker>
  <agm-marker [latitude]="p.Latitude" [longitude]="p.Longitude" *ngFor="let p of embargoViewModelListDisable; "  [iconUrl]="location1.icon">
  <agm-info-window>Latitude : {{p.Latitude}}, Longitude : {{p.Longitude}} PostCode :{{p.PostCode}}</agm-info-window></agm-marker> 
  <agm-kml-layer [url]="'https://www.dropbox.com/s/3bndf59gz24aokg/PO_0800.kml?dl=0'"> </agm-kml-layer>                   
 </agm-map>

【问题讨论】:

    标签: google-maps-api-3 angular5 kml angular-google-maps


    【解决方案1】:

    您的 KML 文件似乎无法从提供的链接 (https://www.dropbox.com/s/3bndf59gz24aokg/PO_0800.kml?dl=0) 公开下载。 如果您在隐身窗口中打开该 URL,您会看到 Dropbox 错误消息,这可能是 Maps API 看到的,而不是获取 KML 文件。确保您的 KML 托管在可公开访问以供直接下载的 URL 上。

    看起来 Dropbox 将通过将 dl= 参数更改为“1”来提供您需要的直接下载,如下所示: https://www.dropbox.com/s/3bndf59gz24aokg/PO_0800.kml?dl=1

    【讨论】:

      猜你喜欢
      • 2019-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 1970-01-01
      • 2014-03-31
      • 2019-03-27
      • 1970-01-01
      相关资源
      最近更新 更多