Limit image layer requests to layer extent

This has two nice consequences that can be seen in the wms-image.js and mapbuide-untiled.js examples:
 * no images are requested when you browse outside of the layer extent
 * when the layer extent is within the viewport extent, cached images are used since the intersecting extent is the same for multiple viewport extents
This commit is contained in:
Tim Schaub
2014-07-06 18:43:08 -06:00
parent 1daf36956c
commit 234cff4de5
5 changed files with 33 additions and 10 deletions

View File

@@ -11,11 +11,11 @@ var layers = [
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Image({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.ImageWMS({
url: 'http://demo.opengeo.org/geoserver/wms',
params: {'LAYERS': 'topp:states'},
serverType: 'geoserver',
extent: [-13884991, 2870341, -7455066, 6338219]
serverType: 'geoserver'
})
})
];