[OpenLayers-Users] zoomToScale Issue

Andrew Haigh haighaj+ollist at googlemail.com
Fri Mar 19 03:45:12 EDT 2010


Bart,

I don't set a list of fixed scales / resolutions and I have now set the
fractionalZoom and everything is now sorted and working ok.

Thanks

Andrew

On 17 March 2010 09:38, <bartvde at osgis.nl> wrote:

> Hi,
>
> how is your map instantiated? With a fixed set of scales/resolutions?
>
> Or are you using fractionalZoom: true in your map config?
>
> Best regards,
> Bart
>
> > All,
> >
> > I'm using OpenLayers (latest trunk version) with GeoServer 2.0.1 to
> > display
> > various layers which have scale rules defined on them within the
> GeoServer
> > SLD (i.e. MaxScaleDenominator and / or MinScaleDenominator).
> >
> > I initially found that the scale in OpenLayers didn't match that in
> > GeoServer but I have followed the steps outlined in this post
> > http://openlayers.org/pipermail/users/2008-October/008453.html and as
> such
> > added the following line before I use any of the OpenLayers classes:
> >
> > OpenLayers.DOTS_PER_INCH = 25.4 / 0.28;
> >
> > This means that the scale displayed by OpenLayers now matches that used
> by
> > GeoServer to one / two decimal places.
> >
> > However, I have found that the map.zoomToScale function no longer works
> as
> > expected. As such when I invoke map.zoomToScale(4578, false) the map
> zooms
> > to a scale of 1:6800 instead of 4578 as expected.
> >
> > Does anybody have any ideas as to what I am doing wrong? Do I need to
> > change
> > something in addition to OpenLayers.DOTS_PER_INCH?
> >
> > Thanks
> >
> > Andrew
>  > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100319/43aaa9f4/attachment.html


More information about the Users mailing list