Skip to content

Commit

Permalink
Rebuild with extentCoordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Apr 30, 2012
1 parent 155aec1 commit 6a43634
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions modestmaps.js
Expand Up @@ -2459,7 +2459,7 @@ var MM = com.modestmaps = {
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();
Expand Down Expand Up @@ -2514,8 +2514,11 @@ var MM = com.modestmaps = {
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)

Expand Down

0 comments on commit 6a43634

Please sign in to comment.