Merge branch '2.12'

This commit is contained in:
Éric Lemoine
2012-04-20 15:29:46 +02:00
8 changed files with 27 additions and 187 deletions

View File

@@ -275,16 +275,6 @@ OpenLayers.Layer = OpenLayers.Class({
* {Float}
*/
minResolution: null,
/**
* Property: resolution
* {Float} Current resolution that the layer is drawn in. This is
* used to determine whether the zoom has changed when calling
* <moveTo> from <redraw>. Subclasses may set this.resolution to
* null prior to calling redraw to force passing zoomChanged
* true to moveTo.
*/
resolution: null,
/**
* APIProperty: numZoomLevels
@@ -566,8 +556,7 @@ OpenLayers.Layer = OpenLayers.Class({
var extent = this.getExtent();
if (extent && this.inRange && this.visibility) {
var zoomChanged = this.resolution == null ||
this.resolution !== this.map.getResolution();
var zoomChanged = true;
this.moveTo(extent, zoomChanged, false);
this.events.triggerEvent("moveend",
{"zoomChanged": zoomChanged});
@@ -592,7 +581,6 @@ OpenLayers.Layer = OpenLayers.Class({
display = display && this.inRange;
}
this.display(display);
this.resolution = this.map.getResolution();
},
/**
@@ -648,8 +636,6 @@ OpenLayers.Layer = OpenLayers.Class({
// deal with gutters
this.setTileSize();
this.resolution = null;
}
},
@@ -889,16 +875,6 @@ OpenLayers.Layer = OpenLayers.Class({
props.resolutions = this.resolutionsFromScales(props.scales);
}
if(props.resolutions == null) {
var maxExtent = this.maxExtent;
if (!props.maxResolution && maxExtent) {
// maxResolution for default grid sets assumes that at zoom
// level zero, the whole world fits on one tile.
var tileSize = this.tileSize || this.map.getTileSize();
props.maxResolution = Math.max(
maxExtent.getWidth() / tileSize.w,
maxExtent.getHeight() / tileSize.h
);
}
props.resolutions = this.calculateResolutions(props);
}
}
@@ -1034,6 +1010,18 @@ OpenLayers.Layer = OpenLayers.Class({
minResolution = Math.max(wRes, hRes);
}
if(typeof maxResolution !== "number" &&
typeof minResolution !== "number" &&
this.maxExtent != null) {
// maxResolution for default grid sets assumes that at zoom
// level zero, the whole world fits on one tile.
var tileSize = this.tileSize || this.map.getTileSize();
maxResolution = Math.max(
this.maxExtent.getWidth() / tileSize.w,
this.maxExtent.getHeight() / tileSize.h
);
}
// determine numZoomLevels
var maxZoomLevel = props.maxZoomLevel;
var numZoomLevels = props.numZoomLevels;

View File

@@ -232,7 +232,8 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
this.map.getProjectionObject(),
new OpenLayers.Projection("EPSG:4326")
);
var providers = res.imageryProviders, zoom = this.map.getZoom() + 1,
var providers = res.imageryProviders,
zoom = this.serverResolutions.indexOf(this.getServerResolution()),
copyrights = "", provider, i, ii, j, jj, bbox, coverage;
for (i=0,ii=providers.length; i<ii; ++i) {
provider = providers[i];

View File

@@ -122,7 +122,6 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
*/
mergeNewParams:function(newParams) {
this.params = OpenLayers.Util.extend(this.params, newParams);
this.resolution = null;
var ret = this.redraw();
if(this.map != null) {
this.map.events.triggerEvent("changelayer", {
@@ -147,7 +146,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
if (force) {
return this.mergeNewParams({"_olSalt": Math.random()});
} else {
return OpenLayers.Layer.prototype.redraw.call(this);
return OpenLayers.Layer.prototype.redraw.apply(this, []);
}
},

View File

@@ -520,20 +520,6 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
}
},
/**
* APIMethod: redraw
* Redraws the layer. Returns true if the layer was redrawn, false if not.
*
* Returns:
* {Boolean} The layer was redrawn.
*/
redraw: function() {
// this is to force Layer.redraw set zoomChanged
// to true in the moveTo call
this.resolution = null;
return OpenLayers.Layer.prototype.redraw.apply(this, arguments);
},
/**
* APIMethod: display
* Hide or show the Layer