Fix a problem determining zoom levels. Updated some docs.
This commit is contained in:
@@ -169,14 +169,13 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.lastXy = evt.xy;
|
||||
}
|
||||
|
||||
var newHtml = this.formatOutput(lonLat);
|
||||
|
||||
var layers = this.findLayers();
|
||||
if (layers.length > 0) {
|
||||
var layer;
|
||||
for (var i=0, len=layers.length; i<len; i++) {
|
||||
layer = layers[i];
|
||||
var info = layer.getTileInfo( lonLat );
|
||||
//MP TODO make function
|
||||
if (this.debugElement) {
|
||||
var debug = "<ul>";
|
||||
debug += "<li>i :" + info.i + "</li>";
|
||||
@@ -192,7 +191,7 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
var tile = info.tile;
|
||||
/*
|
||||
TODO Sanity checks
|
||||
MP TODO Sanity checks
|
||||
if ((Math.floor(info.i) >= tileSize) ||
|
||||
(Math.floor(info.j) >= tileSize)) alert("TOO BIG");
|
||||
*/
|
||||
@@ -217,6 +216,7 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Method: callback
|
||||
* MP TODO
|
||||
* Takes the attrs and does somethings with them
|
||||
* this is a default (intended to be overridden)
|
||||
*/
|
||||
@@ -259,28 +259,11 @@ OpenLayers.Control.UTFGrid = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: formatOutput
|
||||
* Override to provide custom display output
|
||||
*
|
||||
* Parameters:
|
||||
* lonLat - {<OpenLayers.LonLat>} Location to display
|
||||
*/
|
||||
formatOutput: function(lonLat) {
|
||||
var digits = parseInt(this.numDigits);
|
||||
var newHtml =
|
||||
this.prefix +
|
||||
lonLat.lon.toFixed(digits) +
|
||||
this.separator +
|
||||
lonLat.lat.toFixed(digits) +
|
||||
this.suffix;
|
||||
return newHtml;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: findLayers
|
||||
* Internal method to get the layers, independent of whether we are
|
||||
* inspecting the map or using a client-provided array
|
||||
* MP TODO respect list of user-supplied candidates
|
||||
*/
|
||||
findLayers: function() {
|
||||
var candidates = this.layers || this.map.layers;
|
||||
|
||||
Reference in New Issue
Block a user