新手问题 如何实现在 Google map 下 user 实时定位

gavin1818 · June 24, 2016 · Last by chenjau replied at June 24, 2016 · 2128 hits

大家好 我是 Ruby 新手 我想开发一款 location-based 的游戏。现有一个难题,就是如何在 Google map 里实现 user 的实时定位。因为学业不精,我已经卡在这里好几天了。我知道大体的方向,比如说用 google map api, ajax 来实现。但因为还不是很能搞明白 MVC 里各部分之间的关系,所以现在还是一团雾水。有没有朋友能告诉我具体如何实现,相关的文章?谢谢了。

先明确下你想问什么吧。 以及建议先读一下《提问的智慧》。

这是 google 的 geolocation: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation,里面有示例。国内不翻墙可能用不了,需要注册 api key。

整个流程是从 google 那边走的,你整合代码,配置好 api key 即可。和「mvc 之间的关系」好像并没有什么关系。

(貌似 BUG)奇怪,顺便报下:为什么「注册」和「api] 两个词连起来,「api」就不显示了。

You need to Sign in before reply, if you don't have an account, please Sign up first.