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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user