[OpenLayers-Users] ZoomToMaxExtent Control

Scott Davis scott at davisworld.org
Sat Jun 2 09:59:14 EDT 2007


On Jun 1, 2007, at 7:41 PM, Christopher Schmidt wrote:

> On Fri, Jun 01, 2007 at 03:30:03PM -0600, Scott Davis wrote:
>> Hey,
>>
>> Congrats on the 2.4 release.
>>
>> As I'm digging into the API, it appears that the ZoomToMaxExtent
>> control is broken as shipped. (Please correct me if I'm wrong.) It
>> seems to be missing the click handler and the associated CSS to get
>> it to appear. I did the following to get it working. Am I on the
>> right track?
>
> The ZoomToMaxExtent control is actually designed to be added to a
> Control.Panel object, as is demonstrated in:
>
> http://openlayers.org/dev/examples/panel.html
>
> In this case, the CSS, initialize, clicking behavior, etc. are all set
> up by the Control.Panel.
>
> I think this should solve any use case I can think of: if it doesn't,
> I'd like to know about it. I assume that this is just a lack of
> documentation. (For the record, you can remove the rest of the  
> controls
> from the panel and just get the zoomToMaxExtent control.
>
> Does this help you?

Exactly what I was looking for. I didn't care as much about the  
specific control as I did grokking the methodology. I was just going  
down the list: map.addControl(LayerSwitcher), map.addControl 
(OverviewMap), etc. and ZoomToMaxExtent didn't seem to work as the  
others did.

So, (warning: gross generalization ahead) should all controls go in a  
Panel?

BTW, keep your eyes on http://trimet.org. An antiquated ESRI  
interactive map is on its way out, being replaced by a full OSS  
stack: GeoServer, OpenLayers, TileCache, PostGIS, et al. I'll send an  
announcement to the list when it goes live.

Cheers,
s



More information about the Users mailing list