Skip to content

Commit

Permalink
added default_zoom_level option for setting a custom zoom level when …
Browse files Browse the repository at this point in the history
…normal zoom level is inadequate
  • Loading branch information
brianjlandau committed Jul 11, 2010
1 parent 62ce114 commit f4bc9f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ These are options that can be passed to the `jMapping` function to change specif
using something other then just string data in the category, such as an object with multiple data
attributes it's self. The function should return an object with attributes that are
[valid for a MarkerIconOptions object](http://gmaps-utility-library.googlecode.com/svn/trunk/mapiconmaker/1.1/docs/reference.html).
* `default_zoom_level`:
* *Default*: *N/A*
* Use this option to set the default zoom level for your map. Normally, zoom level is set dynamically based on the position of locations being mapped. But, in some cases, like viewing a single mapped location, you may wish to set a default zoom level. Zoom level values should be between 1 and 20. Neighborhood level is approximately 15.


Object API
-----------
Expand Down
3 changes: 3 additions & 0 deletions jquery.jmapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ if (GMap2){
map.addControl(new GSmallMapControl());
}
map.centerAndZoomOnBounds(bounds);
if (typeof settings.default_zoom_level == "number"){
map.setZoom(settings.default_zoom_level);
}
return map;
};

Expand Down
3 changes: 2 additions & 1 deletion jquery.jmapping.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spec/spec_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Screw.Specifications.mockGMapsUpdate = function(marker_mock){
gmap_mock.should_receive('getBoundsZoomLevel').exactly('twice').and_return(10);
gmap_mock.should_receive('setMapType').exactly('once').with_arguments(G_NORMAL_MAP);
gmap_mock.should_receive('addControl').exactly('once').with_arguments(new GSmallMapControl());
gmap_mock.should_receive('checkResize').exactly('once');
GMap2 = function(){};
$.extend(GMap2.prototype, gmap_mock);

Expand Down

0 comments on commit f4bc9f4

Please sign in to comment.