ArcGISCache layer should not generate x and y values of less than 0, p=dmiddlecamp, r=me (closes #3169)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11696 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-03-11 18:34:53 +00:00
parent 5b7d530461
commit 807000c4b7
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -214,8 +214,8 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
*/
getContainingTileCoords: function(point, res) {
return new OpenLayers.Pixel(
Math.floor((point.x - this.tileOrigin.lon) / (this.tileSize.w * res)),
Math.floor((this.tileOrigin.lat - point.y) / (this.tileSize.h * res))
Math.max(Math.floor((point.x - this.tileOrigin.lon) / (this.tileSize.w * res)),0),
Math.max(Math.floor((this.tileOrigin.lat - point.y) / (this.tileSize.h * res)),0)
);
},