【发布时间】:2019-12-27 10:36:56
【问题描述】:
我正在尝试使用 Google 地图 API 加载一些 JSON。
https://developers.google.com/maps/documentation/javascript/datalayer
这是我的小提琴代码:
https://jsfiddle.net/simonrenauld/3z7peqdv/6/
<script src="https://storage.cloud.google.com/jsontestdemp/testdata.jsonp"></script>
我尝试像文档中那样加载为 geojsonp
我仍然无法加载到我的地图中。避免 CORS 政策的简单解决方案是什么?
【问题讨论】:
-
从同一个域或您可以控制的域加载 GeoJSON(以设置 CORS 标头)
标签: javascript google-maps google-api