Layer.XYZ: support a subset of server resolutions, p=bbinet, r=me (closes #2909)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10903 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -40,10 +40,19 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* for a requested tile. For example, if you supply a zoomOffset
|
||||
* of 3, when the map is at the zoom 0, tiles will be requested from
|
||||
* level 3 of your cache. Default is 0 (assumes cache level and map
|
||||
* zoom are equivalent).
|
||||
* zoom are equivalent). Using <zoomOffset> is an alternative to
|
||||
* setting <serverResolutions> if you only want to expose a subset
|
||||
* of the server resolutions.
|
||||
*/
|
||||
zoomOffset: 0,
|
||||
|
||||
/**
|
||||
* APIProperty: serverResolutions
|
||||
* {Array} A list of all resolutions available on the server. Only set this
|
||||
* property if the map resolutions differs from the server.
|
||||
*/
|
||||
serverResolutions: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.XYZ
|
||||
*
|
||||
@@ -114,7 +123,9 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
/ (res * this.tileSize.w));
|
||||
var y = Math.round((this.maxExtent.top - bounds.top)
|
||||
/ (res * this.tileSize.h));
|
||||
var z = this.map.getZoom() + this.zoomOffset;
|
||||
var z = this.serverResolutions != null ?
|
||||
OpenLayers.Util.indexOf(this.serverResolutions, res) :
|
||||
this.map.getZoom() + this.zoomOffset;
|
||||
|
||||
var url = this.url;
|
||||
var s = '' + x + y + z;
|
||||
|
||||
Reference in New Issue
Block a user