<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 100%;
height: 100%;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
// refresh interval in ms
var refreshInterval = 5000;
var map, layer;
function init(){
map = new OpenLayers.Map( $('map'), {'projection': 'EPSG:28992', 'units':'m', 'scales': [2000000, 500000, 250000, 100000, 50000, 25000, 10000], 'maxExtent': new OpenLayers.Bounds(0,300000,300000,600000)});
layer = new OpenLayers.Layer.WMS( "Provincies", 'http://www.rijkswaterstaat.nl/services/geoservices/overzichtskaartnl?', {layers: 'NL-prov', 'format':'image/gif'}, {'buffer': 0, isBaseLayer: true} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WMS( "Intensiteit", 'http://www.rijkswaterstaat.nl/services/geoservices/basispakket/nationaalwegenbestand?', {layers: 'AAA57', 'format':'image/gif', TRANSPARENT:true}, {'buffer': 0, isBaseLayer: false, singleTile: true} );
map.addLayer(layer);
if (!map.getCenter()) map.zoomToMaxExtent();
}
function refreshOverlays()
{
for (i=0; i < map.layers.length; i++) {
layer = map.layers[i];
if (!layer.isBaseLayer && layer.getVisibility) {
layer.grid[0][0] = null;
layer.mergeNewParams({'ttt': Math.random()});
}
}
// repeat refresh
window.setTimeout(refreshOverlays, refreshInterval);
}
window.setTimeout(refreshOverlays, refreshInterval);
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>