Zoom to a layer?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Zoom to a layer?

Tho8183
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Zoom to a layer?

Erik Uzureau
Can you be a little more explicit?
I dont quite understand "zoom to a layer"
-Erik

On 11/30/06, Thomas Zuberbuehler <[hidden email]> wrote:

> Hi
>
> If there are a method in openlayers to zoom to a layer? Or has
> somebody an idea how I can do that?
>
> Otherwise I can query the bbox from PostGIS, but I am searching for a
> method without this sql query.
>
> Thank you.
>
> Regards,
> Thomas
>
> --
> Thomas Zuberbuehler
> http://www.zubi.li
>
>
> --
> Thomas Zuberbuehler
> http://www.zubi.li
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Zoom to a layer?

David Percy
Typically this means "get the bounding box of the layer, and then zoom
to that extent"

Erik Uzureau wrote:

> Can you be a little more explicit?
> I dont quite understand "zoom to a layer"
> -Erik
>
> On 11/30/06, Thomas Zuberbuehler <[hidden email]> wrote:
>> Hi
>>
>> If there are a method in openlayers to zoom to a layer? Or has
>> somebody an idea how I can do that?
>>
>> Otherwise I can query the bbox from PostGIS, but I am searching for a
>> method without this sql query.
>>
>> Thank you.
>>
>> Regards,
>> Thomas
>>
>> --
>> Thomas Zuberbuehler
>> http://www.zubi.li
>>
>>
>> --
>> Thomas Zuberbuehler
>> http://www.zubi.li
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://openlayers.org/mailman/listinfo/users
>>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>

--
David Percy
Geospatial Data Manager
Geology Department
Portland State University
http://gisgeek.pdx.edu
503-725-3373
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Zoom to a layer?

Tim Schaub-2
> Typically this means "get the bounding box of the layer, and
> then zoom to that extent"

Assuming the map variable contains your map:

map.zoomToExtent(map.layers[0].maxExtent);

will zoom to the max extent of the first layer.  Of course this assumes that
you've already set the max extent of the layer, and I think the question is
really about retrieving that extent.  OpenLayers doesn't have any way of
knowing what the extent of your layers are if you don't set them manually.
You'd have to set up something to retrieve the layer extent from the source
(if WMS and MapServer - this is advertised in the capabilities request).

If the WMS is on the same domain that is serving your application, this
would be pretty easy to do.  If the WMS is on a different domain, then you'd
need to set up a proxy server to get the extent.  If you're not talking
about a WMS layer, then more detail would help.

Tim


>
> Erik Uzureau wrote:
> > Can you be a little more explicit?
> > I dont quite understand "zoom to a layer"
> > -Erik
> >
> > On 11/30/06, Thomas Zuberbuehler <[hidden email]> wrote:
> >> Hi
> >>
> >> If there are a method in openlayers to zoom to a layer? Or has
> >> somebody an idea how I can do that?
> >>
> >> Otherwise I can query the bbox from PostGIS, but I am
> searching for a
> >> method without this sql query.
> >>
> >> Thank you.
> >>
> >> Regards,
> >> Thomas
> >>
> >> --
> >> Thomas Zuberbuehler
> >> http://www.zubi.li
> >>
> >>
> >> --
> >> Thomas Zuberbuehler
> >> http://www.zubi.li
> >> _______________________________________________
> >> Users mailing list
> >> [hidden email]
> >> http://openlayers.org/mailman/listinfo/users
> >>
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://openlayers.org/mailman/listinfo/users
> >
>
> --
> David Percy
> Geospatial Data Manager
> Geology Department
> Portland State University
> http://gisgeek.pdx.edu
> 503-725-3373
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users