Increase timeout to avoid flashes.

Without this change, flashes are fairly frequent while zooming around a full screen map.
This commit is contained in:
tschaub
2012-01-02 16:07:40 -07:00
parent 3c910c8801
commit f2168d13b7
3 changed files with 23 additions and 17 deletions
+3 -3
View File
@@ -25,9 +25,8 @@
} }
</style> </style>
<script src="../lib/OpenLayers.js"></script> <script src="../lib/OpenLayers.js"></script>
<script src="fullScreen.js"></script>
</head> </head>
<body onload="init()"> <body>
<div id="map"></div> <div id="map"></div>
<div id="text"> <div id="text">
@@ -38,7 +37,7 @@
</div> </div>
<p id="shortdesc"> <p id="shortdesc">
Demonstrate a map that fill the entire browser window. Demonstrate a map that fills the entire browser window.
</p> </p>
<div id="docs"> <div id="docs">
@@ -48,6 +47,7 @@
<a href="fullScreen.js" target="_blank">fullScreen.js source</a> <a href="fullScreen.js" target="_blank">fullScreen.js source</a>
to see how this is done.</p> to see how this is done.</p>
</div> </div>
<script src="fullScreen.js"></script>
</div> </div>
</body> </body>
</html> </html>
+19 -13
View File
@@ -1,15 +1,21 @@
var map; var urls = [
function init(){ "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
map = new OpenLayers.Map('map'); "http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
];
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", var map = new OpenLayers.Map({
"http://vmap0.tiles.osgeo.org/wms/vmap0", div: "map",
{layers: 'basic'} ); layers: [
var ol_wms_nobuffer = new OpenLayers.Layer.WMS( "OpenLayers WMS (no tile buffer)", new OpenLayers.Layer.XYZ("OSM (with buffer)", urls, {
"http://vmap0.tiles.osgeo.org/wms/vmap0", transitionEffect: "resize", buffer: 2, sphericalMercator: true
{layers: 'basic'}, {buffer: 0}); }),
new OpenLayers.Layer.XYZ("OSM (without buffer)", urls, {
transitionEffect: "resize", buffer: 0, sphericalMercator: true
})
],
center: [0, 0],
zoom: 3
});
map.addLayers([ol_wms, ol_wms_nobuffer]); map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 6);
}
+1 -1
View File
@@ -549,7 +549,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
window.clearTimeout(this.backBufferTimerId); window.clearTimeout(this.backBufferTimerId);
} }
this.backBufferTimerId = window.setTimeout( this.backBufferTimerId = window.setTimeout(
OpenLayers.Function.bind(this.removeBackBuffer, this), 800); OpenLayers.Function.bind(this.removeBackBuffer, this), 2500);
}, },
/** /**