开发者

Mobile Web Rails Wep App with Geolocation

I'd like to develop a Ruby on Rail开发者_开发知识库s app, specially with a mobile web interface, It's a really simple Google Maps powered app, where the user will go in and get directions for a given Place inside a Complex.

Can anyone point me in the right direction? Regarding tools and what tips/tricks I should keep in mind?

I also have a doubts regarding how to determine the user location from a mobile device. How is this accomplish?


I would start with reading Google's API code here:

http://code.google.com/apis/maps/documentation/javascript/basics.html

Specifically the sections on Geolocation and Developing for mobile devices.

From what I've seen, the rails Google Map API plugins and gems are either outdated (they use v2 of the API), or they limit what you can do with them.

I came to the conclusion I was better off digging into the Google API directly and using jQuery to make the AJAX calls to my rails app. Start with a bare bones rails app and implement some of the samples Google provides so you can play around with the interaction with rails.

There is an Apress book "Google Maps Applications with Rails and Ajax", but it's outdated because the API has changed drastically between v2 and v3. But you can still use it as a starting point. You just have to make your own conversions from v2 to v3 in the samples.


You can get location information from the browser using the HTML5 geolocation API.

The best library I have found that supports this cross-browser is: http://code.google.com/p/geo-location-javascript/

The google maps v3 API is very easy to use, so just go start playing with that: http://code.google.com/apis/maps/documentation/javascript/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜