Reputation: 7359
I'm using Google Maps V3 and it's not only having trouble getting exact geolocations, it's sometimes not finding the correct city (even missing by more than 50 miles in some cases).
The way I'm using google maps is in my Rails 3 app with the gem 'geocoder'. I feel pretty sure it's not the geocoder gem that's causing google maps to be off, I think I've had this problem in google maps V3 before.
My question: is there a better experience for determining the user's location? Should I use the browser's built in geolocation features? Or should I be using a combination of Google Maps Geolocation and the browser's geolocation functions?
I imagined a scenario where I could ask the user if the town was correct, and if not they could enter their town, then store their town in the database, but it seems like a poor user experience. I hope to make this a app on mobile devices in the future, where it wouldn't be much of a problem, but for now it's a web app.
Anybody else have a good system for dealing with apps that rely on a user's location? Thanks!
Upvotes: 0
Views: 1136
Reputation: 26
I ran into the same problem with Geocoder. For me it appeared to not interpret the address correctly in certain cases. If I sent it '250w 450n' as the street address I would get back the coords for *formatted_address":"250 E 450 S,*. If I sent '250 w 450 n' I got back the exact location I was looking for. Try checking the json response you get back from Geocoder, it will tell you "partial_match":true,"types":["street_address"]}} if it "guessed" at something, and you can check the returned *formatted_address* to see what it came up with.
you can use their website as a quick check on what response you would get for a given address string.
Upvotes: 1