简体   繁体   中英

How to include Google Maps JS library locally and not from CDN

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM