Javascript 在移动网站上显示谷歌地图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2415081/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Show google maps on mobile website
提问by GatesReign
Is it possible to add google maps on a site designed specifically for the iPhone? I have never integrated maps in my websites before, so this question really goes more because of my inexperience. Using basic html and javascript at the moment.
是否可以在专为 iPhone 设计的网站上添加谷歌地图?我以前从未在我的网站中集成地图,因此由于我的经验不足,这个问题确实更多。目前使用基本的 html 和 javascript。
回答by Chris B
The Google Maps API V3is specifically designed to work efficiently on mobile devices. There are some great tutorials hereand here.
在谷歌地图API V3是专为移动设备上高效地工作。这里和这里有一些很棒的教程。
回答by Arclite
Any link to a Google Maps URL will automatically open in the Maps application, which may be more useful than simply embedding a map view in the website itself.
任何指向 Google 地图 URL 的链接都将在地图应用程序中自动打开,这可能比简单地将地图视图嵌入网站本身更有用。
For example, a link to http://maps.google.com/maps?q=cupertinowill automatically open the Maps application and run a search for "cupertino".
例如,指向http://maps.google.com/maps?q=cupertino的链接将自动打开地图应用程序并搜索“cupertino”。
回答by Void.Tan
I think, if you only need a google map with some simple function. The simplest way is use the MapKit.Framework, it's a part of iphone OS. You can find the document here.
我想,如果你只需要一个具有一些简单功能的谷歌地图。最简单的方法是使用 MapKit.Framework,它是 iphone OS 的一部分。您可以在此处找到该文档。
If you need to load your own web site, you need to use UIWebView. you can find the document here(http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html).
如果您需要加载自己的网站,则需要使用 UIWebView。您可以在此处找到该文档(http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html)。
I think these two ways can help you solve your problem. And sorry about the link, because I'm not allowed to post more than one hyperlink.
我认为这两种方法可以帮助您解决问题。对链接感到抱歉,因为我不允许发布多个超链接。

