Changing/fixing the meaning of getServerZoom.
If a layer is configured with serverResolutions, then getServerZoom should return the zoom level as index of the current resolution in the serverResolutions array.
This commit is contained in:
@@ -658,7 +658,10 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
* {Number} The closest server supported zoom.
|
||||
*/
|
||||
getServerZoom: function() {
|
||||
return this.map.getZoomForResolution(this.getServerResolution());
|
||||
var serverResolution = this.getServerResolution();
|
||||
return this.serverResolutions ?
|
||||
this.serverResolutions.indexOf(serverResolution) :
|
||||
this.map.getZoomForResolution(serverResolution);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user