Permalink
Browse files

Remove pyramid loading mode

  • Loading branch information...
tmcw committed Apr 12, 2012
1 parent eed8592 commit df87fdccf07d90c5006ae38321d140d0932cf477
Showing with 11 additions and 63 deletions.
  1. +5 −31 modestmaps.js
  2. +1 −1 modestmaps.min.js
  3. +5 −31 src/layer.js
View
@@ -1565,7 +1565,6 @@ var MM = com.modestmaps = {
levels: null,
requestManager: null,
provider: null,
- enablePyramidLoading: false,
_tileComplete: null,
getTileComplete: function() {
@@ -1696,39 +1695,16 @@ var MM = com.modestmaps = {
var parent_coord = tile_coord.zoomBy(-pz).container();
var parent_key = parent_coord.toKey();
- if (this.enablePyramidLoading) {
- // mark all parent tiles valid
+ // only mark it valid if we have it already
+ if (parent_key in this.tiles) {
valid_tile_keys.push(parent_key);
- var parentLevel = this.createOrGetLevel(parent_coord.zoom);
-
- //parentLevel.coordinate = parent_coord.copy();
- if (parent_key in this.tiles) {
- var parentTile = this.tiles[parent_key];
- if (parentTile.parentNode != parentLevel) {
- parentLevel.appendChild(parentTile);
- }
- } else if (!this.requestManager.hasRequest(parent_key)) {
- // force load of parent tiles we don't already have
- var tileToAdd = this.provider.getTile(parent_coord);
-
- if (typeof tileToAdd == 'string') {
- this.addTileImage(parent_key, parent_coord, tileToAdd);
- } else {
- this.addTileElement(parent_key, parent_coord, tileToAdd);
- }
- }
- } else {
- // only mark it valid if we have it already
- if (parent_key in this.tiles) {
- valid_tile_keys.push(parent_key);
- tileCovered = true;
- break;
- }
+ tileCovered = true;
+ break;
}
}
// if we didn't find a parent, look at the children:
- if (!tileCovered && !this.enablePyramidLoading) {
+ if (!tileCovered) {
var child_coord = tile_coord.zoomBy(1);
// mark everything valid whether or not we have it:
@@ -1914,12 +1890,10 @@ var MM = com.modestmaps = {
}
// first provider or not we'll init/reset some values...
-
this.tiles = {};
// for later: check geometry of old provider and set a new coordinate center
// if needed (now? or when?)
-
this.provider = newProvider;
if (!firstProvider) {
Oops, something went wrong.

0 comments on commit df87fdc

Please sign in to comment.