[OpenLayers-Users] Problem with zoomexents and google maps la yer

Christopher Schmidt crschmidt at metacarta.com
Mon Jul 16 21:29:24 EDT 2007


On Mon, Jul 16, 2007 at 09:24:24PM -0400, Stephen Woodbridge wrote:
> Anyway, I'm looking for a work-around. If we could do something like:
> 
> var zoomlevel = map.getZoomForExtent(ci.Bounds);
> var bounds = map.getExtentForZoomLevel(zoomlevel);
> if (overlaps(bounds, ci.Bounds) && zoomlevel > 0)
>    zoomlevel--;
> 
> I think this would work. How would we do the equivalent of:
> 
> var bounds = map.getExtentForZoomLevel(zoomlevel);

No clue. If we could do this accurately, we wouldn't be having this
discussion, since this is how the code is already supposed to work :)
The problem is that because Google isn't linear, the only way we have of
getting accurate corners from a center and zoom is to zoom there, and
ask the Google layer. (I think. Corrections welcome)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list