[OpenLayers-Users] no predefined zoomlevels

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Mon Feb 12 11:21:39 EST 2007


Okay, that makes sense.

Would I still be able to use the PanZoomBar control and assign a set of
scales to the PanZoomBar? So that it would represent street level,
neighbourhood level etc.? Or does it always take the scales from the map?

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Christopher Schmidt <crschmidt at metacarta.com>
Naar: Bart van den Eijnden OSGIS <bartvde at osgis.nl>
Cc: users at openlayers.org
Onderwerp: Re: [OpenLayers-Users] no predefined zoomlevels
Datum: 12/02/07 14:11

> On Mon, Feb 12, 2007 at 04:34:47PM +0100, Bart van den Eijnden (OSGIS)
wrote:
> &gt; Hi Christopher,
> &gt; 
> &gt; I've seen this post. But isn't this to zoom to a specific scale?
> &gt;
> &gt; Or would I need to make my own set of controls and calculate the
scale based
> &gt; on the zoombox the user has drawn, and then use the workaround from
the
> &gt; post?
> 
> Yeah. What I would do:
> 
> I would make a subclass of the MouseWhatever control you are currently
> using. Once you've done that, you replace the zoomBoxEnd function:
> There's very litle you need to do other than copy the existing code and
> change:
> 
>          var bounds = new OpenLayers.Bounds(left, bottom, right, top);
>          this.map.zoomToExtent(bounds);
> 
> To instead calculate the resolution of the box and zoom to that scale,
> then set the center. (or the other way around.)
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> 
> 






More information about the Users mailing list