Permalink
Browse files

Merge pull request #129 from aibram/extent-coordinate

Expose extent to coordinate conversion
  • Loading branch information...
tmcw committed Apr 30, 2012
2 parents 32cd691 + cfdf263 commit 155aec162b56bc9af6f8d4eb49fe3f717f170ee7
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/map.js
View
@@ -216,7 +216,7 @@
return this;
},
- setExtent: function(locations, precise) {
+ extentCoordinate: function(locations, precise) {
// coerce locations to an array if it's a Extent instance
if (locations instanceof MM.Extent) {
locations = locations.toArray();
@@ -271,8 +271,11 @@
var centerRow = (TL.row + BR.row) / 2;
var centerColumn = (TL.column + BR.column) / 2;
var centerZoom = TL.zoom;
+ return new MM.Coordinate(centerRow, centerColumn, centerZoom).zoomTo(initZoom);
+ },
- this.coordinate = new MM.Coordinate(centerRow, centerColumn, centerZoom).zoomTo(initZoom);
+ setExtent: function(locations, precise) {
+ this.coordinate = this.extentCoordinate(locations, precise);
this.draw(); // draw calls enforceLimits
// (if you switch to getFrame, call enforceLimits first)

0 comments on commit 155aec1

Please sign in to comment.