[OpenLayers-Users] Layer use of maxExtent to limit retrieving tiles from WMS service.

Linda Rawson linda.rawson at gmail.com
Sun Sep 16 19:23:47 EDT 2007


I have a wms layer that is the whole world.  I have another wms layer that
is part of the world, Canada.  I want the part world to only retrieve data
and show when I am in that area of the world.

I thought I could do it with the following command on the layer
(maxExtent,  displayOutsideMaxExtent = false) but it is still retrieving the
data all of the time.  What can I do to limit it from retrieving the layer
and only displaying the layer on certain lat/lon coordinates?


layerOptions = [];

layerOptions.push('VEGETATION_2:BNDT_50K/NTDB_50K');
var dm_wms = new OpenLayers.Layer.WMS( "Canada",

"http://wms.cits.rncan.gc.ca/cgi-bin/cubeserv.cgi?",

{

layers : layerOptions,

format : "image/jpeg",

transparent: "true"

},

{ maxResolution: 0.00137329101,

tileSize: new OpenLayers.Size(512,512),

maxExtent: new OpenLayers.Bounds(-169.6464945168233,27.90109187663068,-
20.01420323537291,78.92465549183306)

}

);

dm_wms.displayInLayerSwitcher = false;

dm_wms.displayOutsideMaxExtent = false;
map.addLayer(dm_wms);

Thanks,
Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070916/15986ee7/attachment.html


More information about the Users mailing list