简体   繁体   English

实施谷歌地图的最佳方式

[英]Best way to implement google maps

I found two way to implement google maps.我找到了两种实现谷歌地图的方法。

The First One第一个

<script src = "http://maps.googleapis.com/maps/api/js"></script>

The Second One第二个

<script type="text/javascript" src="http://www.google.com/jsapi?key=....key"></script>

my questions:-我的问题:-

1- What is difference between them? 1-它们之间有什么区别?

2- Can I download (save) a part of google maps (my country map or city) to my localhost? 2-我可以将部分谷歌地图(我的国家/地区地图或城市)下载(保存)到我的本地主机吗?

For your second question对于你的第二个问题

By Broswer Google maps can only be executed using internet.通过 Broswer 谷歌地图只能使用互联网执行。 Eventually local copy are actually not allowed and above all does not work.最终本地副本实际上是不允许的,最重要的是不起作用。 Google Maps can used only as a service and not as a local library. Google 地图只能用作服务,不能用作本地图书馆。 For Mobile you can access (and also edit) your maps locally eg see this对于移动设备,您可以在本地访问(也可以编辑)您的地图,例如查看此

In HTML5, you no longer need to define the type attribute for JS includes, so this format works:在 HTML5 中,你不再需要为 JS include 定义type属性,所以这种格式有效:

<script src = "http://maps.googleapis.com/maps/api/js"></script>

Additionally, you are referencing the v3 of the Google Maps API with the above URL - see here in their documentation .此外,您正在使用上述 URL 引用 Google Maps API 的 v3 - 请在其文档中查看此处

First question: This was answered by @staypuftman.第一个问题:@staypuftman 回答了这个问题。

Second question: You may save a local copy of a part of google maps using Google Static Maps which will return a value as an image file.第二个问题:您可以使用谷歌静态地图保存部分谷歌地图的本地副本,这将返回一个图像文件的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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