From e955fcc6daafffae551926e5340635834d297f9e Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 16 Aug 2006 22:56:47 +0000 Subject: [PATCH] We now have a concept of scale with the map, so we no longer need to depend on this being specific to KaMap. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1263 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/KaMap.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js index d8177e09a0..36aa7a154c 100644 --- a/lib/OpenLayers/Layer/KaMap.js +++ b/lib/OpenLayers/Layer/KaMap.js @@ -17,7 +17,7 @@ OpenLayers.Layer.KaMap.prototype = */ isBaseLayer: true, - units: 'degrees', + units: null, resolution: OpenLayers.DOTS_PER_INCH, @@ -26,12 +26,8 @@ OpenLayers.Layer.KaMap.prototype = map: '' }, - // this.cellSize = newScale/(oMap.resolution * inchesPerUnit[oMap.units]); - // kaMap.prototype.geoToPix = function( gX, gY ) { var pX = gX / this.cellSize; var pY = -1 * gY / this.cellSize; } - initialize: function(name, url, params, units, resolution, options) { + initialize: function(name, url, params, options) { var newArguments = new Array(); - if (units) this.units = units; - if (resolution) this.resolution = resolution; newArguments.push(name, url, params, options); OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); this.params = (params ? params : {}); @@ -53,13 +49,7 @@ OpenLayers.Layer.KaMap.prototype = */ getURL: function (bounds) { var zoom = this.map.getZoom(); - var maxRes = this.map.maxResolution; - var mapRes = this.map.getResolution(); - var scale = Math.round( (((this.tileSize.w * this.map.maxResolution * this.resolution) * - (OpenLayers.INCHES_PER_UNIT[this.units])) / - this.tileSize.w) - / Math.pow(2, zoom) * 10000 ) / 10000; - + var scale = this.map.getScale(); var cellSize = new OpenLayers.Size(mapRes*this.tileSize.w, mapRes*this.tileSize.h); var pX = Math.round(((bounds.left) / cellSize.w) * this.tileSize.w); var pY = -Math.round(((bounds.top) / cellSize.h) * this.tileSize.h);