Support specifying grid resolution at the layer level
This commit is contained in:
@@ -105,7 +105,6 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
options = options || {};
|
options = options || {};
|
||||||
options.handlerOptions = options.handlerOptions || {};
|
options.handlerOptions = options.handlerOptions || {};
|
||||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||||
console.log(this);
|
|
||||||
if (options.div) {
|
if (options.div) {
|
||||||
this.element = OpenLayers.Util.getElement(options.div);
|
this.element = OpenLayers.Util.getElement(options.div);
|
||||||
}
|
}
|
||||||
@@ -135,7 +134,7 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
this.writeDebugInfo(info);
|
this.writeDebugInfo(info);
|
||||||
var tile = info.tile;
|
var tile = info.tile;
|
||||||
var attrs = null;
|
var attrs = null;
|
||||||
var resolution = 4; //TODO autodetect?
|
var resolution = layer.utfgridResolution || 4;
|
||||||
if (tile !== null && typeof(tile) !== 'undefined') {
|
if (tile !== null && typeof(tile) !== 'undefined') {
|
||||||
var data = tile.json
|
var data = tile.json
|
||||||
if (data !== null) {
|
if (data !== null) {
|
||||||
|
|||||||
@@ -136,6 +136,14 @@ OpenLayers.Layer.UTFGrid = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
|||||||
return OpenLayers.String.format(url, xyz);
|
return OpenLayers.String.format(url, xyz);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIProperty: utfgridResolution
|
||||||
|
* {Number} Number of pixels per grid "cell"
|
||||||
|
* Defaults to 4
|
||||||
|
*/
|
||||||
|
utfgridResolution: 4,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: getTileInfo
|
* Method: getTileInfo
|
||||||
* Get tile information for a given location at the current map resolution.
|
* Get tile information for a given location at the current map resolution.
|
||||||
|
|||||||
Reference in New Issue
Block a user