如何在本地而不是从CDN中包含Google Maps JS库 [英] How to include Google Maps JS library locally and not from CDN

查看:127
本文介绍了如何在本地而不是从CDN中包含Google Maps JS库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在从我的混合移动应用中的谷歌CDN中加载谷歌地图JS API。

 < script type =text / javascriptsrc =https://maps.googleapis.com/maps/api / JS库=地方,几何>?< /脚本> 

有没有一种干净的,官方的方式将这个库本地包含在我的资源中?我不能为例子找到一个官方凉亭组件,等等......

例如

 < script type =text / javascriptsrc =lib / maps / api / js?libraries = places,geometry>< / script> 

我可以从上面的URL下载JS文件并将其包含在我的网站中的相关文件夹中app?

解决方案

没有。 条款声明:



< blockquote>

10.1管理限制



除通过服务外,不得访问API或内容。除通过服务之外,您不会访问Maps API或内容。
例如,您不能通过
接口或频道(包括未记录的Google界面)
访问地图图块或图像。



10.5知识产权限制

不使用服务以外的内容。除非在(d)小节中明确允许,否则您不会使用服务
以外的任何内容。例如,
您不会将内容导出或保存到第三方平台或
服务。没有缓存或存储。您不会预先获取,缓存,索引,
或存储任何在服务之外使用的内容,除非您
可能仅为
的目的存储有限数量的内容,由于
的网络延迟(而不是为了防止Google从
准确跟踪使用情况),并且只有在存储空间不足的情况下才能执行您的Maps API实施:


  • 是临时性的(在任何情况下均不得超过30个日历日);

  • 是安全的;
  • 不处理或汇总内容或服务的任何部分;
  • Currently I am loading the google maps JS API from the google CDN like this in my hybrid mobile app.

    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places,geometry"></script>
    

    Is there a clean, official, way to include this library locally in my resources? I cannot for exmaple find an official bower component, etc...

    eg

    <script type="text/javascript" src="lib/maps/api/js?libraries=places,geometry"></script>
    

    Can I just download the JS file from the above URL and include it in the relevant folder in my web app?

    解决方案

    No. The Terms state:

    10.1 Administrative Restrictions.

    No access to APIs or Content except through the Service. You will not access the Maps API(s) or the Content except through the Service. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).

    10.5 Intellectual Property Restrictions.
    No use of Content outside the Service. You will not use any Content outside of the Service except as expressly permitted to do so in Subsection (d). For example, you will not export or save the Content to a third party’s platform or service. No caching or storage. You will not pre-fetch, cache, index, or store any Content to be used outside the Service, except that you may store limited amounts of Content solely for the purpose of improving the performance of your Maps API Implementation due to network latency (and not for the purpose of preventing Google from accurately tracking usage), and only if such storage:

    • is temporary (and in no event more than 30 calendar days);
    • is secure;
    • does not manipulate or aggregate any part of the Content or Service; and
    • does not modify attribution in any way.

    这篇关于如何在本地而不是从CDN中包含Google Maps JS库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆