apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Location not detected #87

Closed tkgospodinov closed 13 years ago

tkgospodinov commented 13 years ago

I am creating a map and trying to detect the location and center the map using

<%= gmaps( {:map_options => { :provider => "google", :disableDefaultUI => "true", :auto_adjust => "true", :detect_location => "true", :center_on_user => "true" }}, false, true) %>

but the location is not detected at all and the map is centered on a random location.

The above code seems to produce the following JavaScript:

I can successfully obtain the current location and center the map using the Google Maps API v3 in JavaScript.

apneadiving commented 13 years ago

This was related to the bug 85, when no markers were passed. I'm just going to release a new version.

BTW, you could replace your code with:

<%= gmaps( {:map_options => { :disableDefaultUI => "true", :auto_adjust => "true", :center_on_user => "true" }}, false, true) %>
apneadiving commented 13 years ago

1.1.3 released with fix.

tkgospodinov commented 13 years ago

Thanks for the quick turnaround.

tkgospodinov commented 13 years ago

I updated the gem to 1.1.4 this evening, and my location is still not being detected.

apneadiving commented 13 years ago

Just remarked you're passing "true" (string) instead of true (boolean)