Google Maps Javascript v3 问题,如何通过 URL 而不是表单输入传递位置
我想像这样使用谷歌的地理编码:
http: //code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html
但是是否可以通过浏览器而不是表单输入来传递位置。 http://www.mydomain/myiphonemap .html?somevariable=210+Main+Street+Some+City+Some+NJ+08260
javascript 需要如何更改才能完成此操作?
I would like to use the google's geocoding like this:
http://code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html
But is it possible to pass the location through the browser rather than the form input.
http://www.mydomain/myiphonemap.html?somevariable=210+Main+Street+Some+City+Some+NJ+08260
How would the javascript need to change to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定 js 需要如何更改,因为我现在不知道它是什么,但您确实可以通过 URL 传递地址,如下所示:
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=500 +4th+St,+San+Francisco,+CA+94107&ie=UTF8&t=h&z=16
有许多变量可以添加到 URL 或从 URL 中删除 - 语言、缩放和等等。
I'm not sure how js would need to be changed as I don't know what is it right now, but you indeed can pass address through URL, like so:
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=500+4th+St,+San+Francisco,+CA+94107&ie=UTF8&t=h&z=16
There are many variables that can be added or removed to/from URL - language, zoom, and so on and so forth.