Permalink
Browse files

Add parameter for zoom level

  • Loading branch information...
1 parent 9e2ac26 commit 74d5684f627ecc0b7e25105c57f339fb06dadef3 Dave Katten committed with jasonl Jan 27, 2012
@@ -7,7 +7,7 @@
var latlng = new google.maps.LatLng(#{form.object.send(field.name) || field.default_latitude}, #{form.object.send(field.longitude_field) || field.default_longitude});
var myOptions = {
- zoom: 8,
+ zoom: #{field.default_zoom_level},
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
@@ -28,6 +28,11 @@ class Map < RailsAdmin::Config::Fields::Base
-0.126 # Longitude of London, United Kingdom
end
+ # Default zoom level of the map
+ register_instance_option(:default_zoom_level) do
+ 8
+ end
+
def dom_name
@dom_name ||= "#{bindings[:form].object_name}_#{@name}_#{@longitude_field}"
end

0 comments on commit 74d5684

Please sign in to comment.