[OpenLayers-Users] relation between fractionalZoom and map.getSize().h

jhpoosthoek jhpoosthoek at gmail.com
Mon Jul 25 14:31:49 EDT 2011


I'm working with a fullscreen OpenLayers map which I want to show in its
maximum extent (a WMS global layer with wrapDateLine: true). Because
map.zoomToMaxExtent() zoom further out then the maximum possible extent (it
shows > +/-90 degrees latitude) I'm trying to create such a function myself.

I work with fractionalZoom = true and am trying to find the perfect zoom for
each map.getSize().h to make it screen size independent.

Does anyone know the relation between map.getSize().h and the fractionalZoom
level?

I tried linear: map.zoomTo(0.006011 * map.getSize().h - 1.505821);
and logarithmic: map.zoomTo(2.74 * Math.log(map.getSize().h) - 15.45);
by creating a trend line in Open Office Calc. But these don't provide a good
fit relation.

Does anyone know the relation/function I should use?

Thank in advance,

Jelmer Oosthoek

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/relation-between-fractionalZoom-and-map-getSize-h-tp6619442p6619442.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list