[OpenLayers-Dev] Format.WMC and scale

Tim Schaub tschaub at opengeo.org
Mon Oct 27 23:46:34 EDT 2008


Hey Bart-

bartvde at osgis.nl wrote:
> Hi list,
> 
> question about the Format.WMC code.
> 
> When it reads a scale from a WMC doc, it is stored in the options array of
> the layer.
> 
> But when it writes, it uses the minScale or maxScale property of the layer.
> 

Are you using WMC v1.1?  If so, it should be writing from 
layer.options.minScale and layer.options.maxScale (not layer.minScale 
and layer.maxScale).

http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Format/WMC/v1_1_0.js#L86

Let me know if you are seeing something different.

> Why is this? I would expect when writing to also use the options.minScale
> and options.maxScale.
> 
> In my situation options.minScale is 35000 (the correct value) and
> layer.minScale is 10000000.999999998, don't ask me why :-). So when
> serializing the WMC the wrong information is written.

Are you saying that the problem is the change in precision?

If so, we could open a ticket to correct this for 
OpenLayers.Util.getResolutionFromScale and getScaleFromResolution (so 
that one is the compliment of the other).

If you (or Eric) think that maxScale is being disregarded when passed as 
a layer option, please provide a test case.  We corrected the grossest 
case where this was occurring (in initResolutions) in r6332.
http://trac.openlayers.org/changeset/6332

(See the test cases there, would be good to have ones that don't pass if 
there is a problem.)

Tim

> 
> Best regards,
> Bart
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list