Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't zoom all the way in when there's only one point. Go as far as M…

…ap.maxZoom.
  • Loading branch information...
commit 9f67a330ac004c62fc811f53340190a6a47e7730 1 parent 0c2deb7
Daniel Morrison danielmorrison authored
Showing with 8 additions and 1 deletion.
  1. +2 −0  Readme.textile
  2. +6 −1 map.js
2  Readme.textile
View
@@ -4,6 +4,8 @@ Google Maps should be easy to add anywhere. Simply mark up your content with "hC
Don't know your latitude & longitude? No problem, we'll look them up for you! Have them already? We'll use them.
+It will fit all the points into view automatically!
+
h2. Requirements
* "Sumo":http://github.com/danwrong/sumo (javascript microformats parser)
7 map.js
View
@@ -92,7 +92,12 @@ var Map = {
},
fitPoints: function() {
- Map.map.fitBounds(Map.bounds);
+ if (Map.points > 1) {
+ Map.map.fitBounds(Map.bounds);
+ } else {
+ Map.map.setCenter(Map.center);
+ Map.map.setZoom(Map.maxZoom);
+ }
},
geocoder: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.