How to center map in gmaps4rails?

i want to display a map centered to a specific location. In my controller, I use

@gmapsoptions = {
     "map_options" => {"center_latitude" => 40, 
                       "center_longitude" => 73,
                       "detect_location" => false,
                       "center_on_user" => false,
                       "auto_adjust" => false,
                       "auto_zoom" => false,
                       "zoom" => 8 }

and in my view i use

<%= gmaps(@gmapsoptions) %>

It renders the map just fine, but it is not centered on the location specified above but on "0/0" aka the dateline. How can I fix this?


Just checked your repo, you should simply have auto_zoom set to true (or remove it since it's the default value).

Need Your Help

Retrieving value from an object within a Map

java object map

I am writing an interpreter program and I am stuck at the moment with this.

Save a list of objects in django

python django django-views django-orm django-1.5

I am using django 1.5 and i am trying to do something like this :