[OpenLayers-Users] max/minScale Values

Jochen Grefe jochen.grefe at ingenieurteam2.com
Thu Jun 28 07:32:49 EDT 2007


Hello,
At first I'm new to OL so please forgive my ignorance of anything obvisious.
I want to set max/minScale Values on initialization of a Layer: 
new OpenLayers.Layer.KaMap('B1','...uri...',{g: 'B1',map: 'map',i: 'png'},{minScale: 499,maxScale: 3001})
But if I add this layer to the map via: map.addLayers(layers); 
the layer values are overwritten by the map values for max/minScale
on initResolution of OpenLayers.Layer (Called by addLayer/Map -> setMap/Grid ->setMap/Layer)
Since I don't know the desired handling, I assume that the layer settings should
only be overwritten if they are not set. In lib/layer.js that would guide me to:
546,547c546,549
<         this.minScale = this.scales[0];
<         this.maxScale = this.scales[this.scales.length - 1];
---
>         if (this.minScale == null)
>          this.minScale = this.scales[0];
>         if (this.maxScale == null)
>          this.maxScale = this.scales[this.scales.length - 1];

Best regards,
Jochen








More information about the Users mailing list