Created
February 8, 2012 16:06
-
-
Save robertmilner/1770744 to your computer and use it in GitHub Desktop.
Gmaps4rails - Set Zoom Level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# commented out original gmaps4rails code to compare %> | |
<%#= gmaps4rails(@json) %> | |
<%= gmaps( | |
:markers => { :data => @json }, | |
:map_options => { :auto_adjust => true, # :auto_adjust map to center on location | |
:auto_zoom => false, # :auto_zoom defaults to full zoom in, set to false to utilize :zoom | |
:zoom => 15 } # :zoom 0 is fully zoomed out (world view), 21 is fully zoomed in (street view) | |
) %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace default gmaps4rails(@JSON) ebr in your view to add the ability to set your zoom level.
Code Academy students, we placed this code in our show.html.erb file.