Merge pull request #3 from tschaub/fade
increase timeout for backbuffer removal and dispense with extra map property
This commit is contained in:
@@ -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
@@ -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);
|
|
||||||
}
|
|
||||||
@@ -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);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -395,14 +395,6 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
* the popup from getting too close to the map border.
|
* the popup from getting too close to the map border.
|
||||||
*/
|
*/
|
||||||
paddingForPopups : null,
|
paddingForPopups : null,
|
||||||
|
|
||||||
/**
|
|
||||||
* APIProperty: tileAnimation
|
|
||||||
* {Boolean} If set to true the olMapTileAnim class is assigned to the
|
|
||||||
* map div. This, with OpenLayers' default CSS, results in fade-in
|
|
||||||
* effects when image tiles are displayed.
|
|
||||||
*/
|
|
||||||
tileAnimation: true,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: minPx
|
* Property: minPx
|
||||||
@@ -508,9 +500,6 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
OpenLayers.Element.addClass(this.div, 'olMap');
|
OpenLayers.Element.addClass(this.div, 'olMap');
|
||||||
if (this.tileAnimation) {
|
|
||||||
OpenLayers.Element.addClass(this.div, 'olMapTileAnim');
|
|
||||||
}
|
|
||||||
|
|
||||||
// the viewPortDiv is the outermost div we modify
|
// the viewPortDiv is the outermost div we modify
|
||||||
var id = this.id + "_OpenLayers_ViewPort";
|
var id = this.id + "_OpenLayers_ViewPort";
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
function test_loadEvents(t) {
|
function test_loadEvents(t) {
|
||||||
t.plan(3);
|
t.plan(3);
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map', {tileAnimation: false});
|
var map = new OpenLayers.Map('map');
|
||||||
var layer = new OpenLayers.Layer.Image(
|
var layer = new OpenLayers.Layer.Image(
|
||||||
'Test', '../../img/blank.gif',
|
'Test', '../../img/blank.gif',
|
||||||
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
||||||
|
|||||||
@@ -115,24 +115,6 @@
|
|||||||
map.destroy();
|
map.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_Map_constructor_tileanim(t) {
|
|
||||||
t.plan(4);
|
|
||||||
|
|
||||||
map = new OpenLayers.Map("map");
|
|
||||||
t.eq(map.tileAnimation, true,
|
|
||||||
'tileAnimation is true by default');
|
|
||||||
t.ok(OpenLayers.Element.hasClass(map.div, 'olMapTileAnim'),
|
|
||||||
'map div is assigned the olMapTileAnim class by default');
|
|
||||||
map.destroy();
|
|
||||||
|
|
||||||
map = new OpenLayers.Map("map", {tileAnimation: false});
|
|
||||||
t.eq(map.tileAnimation, false,
|
|
||||||
'tileAnimation is false if option is false');
|
|
||||||
t.ok(OpenLayers.Element.hasClass(map.div, 'olMapTileAnim'),
|
|
||||||
'map div not assigned the olMapTileAnim class if tileAnimation is false');
|
|
||||||
map.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_Map_setOptions(t) {
|
function test_Map_setOptions(t) {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
map = new OpenLayers.Map('map', {maxExtent: new OpenLayers.Bounds(100, 200, 300, 400)});
|
map = new OpenLayers.Map('map', {maxExtent: new OpenLayers.Bounds(100, 200, 300, 400)});
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a {
|
|||||||
* Animations
|
* Animations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.olMapTileAnim .olTileImage {
|
.olTileImage {
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-webkit-transition: opacity 0.2s linear;
|
||||||
-moz-transition: opacity 0.2s linear;
|
-moz-transition: opacity 0.2s linear;
|
||||||
-o-transition: opacity 0.2s linear;
|
-o-transition: opacity 0.2s linear;
|
||||||
|
|||||||
Reference in New Issue
Block a user