[OpenLayers-Users] mapExtents for Layer vs mapExtents for Map

Eric Lemoine eric.lemoine at camptocamp.com
Mon Nov 23 01:33:35 EST 2009


On Friday, November 20, 2009, srweal <srweal at gmail.com> wrote:
>
> Hi there,
>
> I'm a new OpenLayers user and am struggling with the use of the mapExtent
> setting.  I have a WMS that renders imagery for me, which is being accessed
> through a TileCache.  The imagery only covers part of my entire map, so I
> want to make sure OpenLayers is not requesting image tiles for areas beyond
> the extent of the layer.
>
> However, when I set a mapExtent on my WMS layer to something like
> (135,-45,180,0), it is still displaying 'pink tiles' over top of the base
> layer of the map (which has mapExtent -something like 180,-90,180,90).  This
> seems wrong, as the WMS layer may be set up to only return tiles inside the
> BBOX (135,-45,180,0).  Am I missing something here with the way these
> options are supposed to work?  Please explain.

OpenLayers uses the current base layer's maxExtent as the max extent
for the map. So your WMS layer must be a base layer for its maxExtent
to be taken into account. Also, make sure you use "maxExtent", and not
"mapExtent".

cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list