From 3c910c88018e92ea2e8f44f8279f6d46055064c3 Mon Sep 17 00:00:00 2001 From: tschaub Date: Mon, 2 Jan 2012 15:49:55 -0700 Subject: [PATCH 1/2] Removing the tileAnimation map property. Edit CSS to change the style. --- lib/OpenLayers/Map.js | 11 ----------- tests/Layer/Image.html | 2 +- tests/Map.html | 18 ------------------ theme/default/style.css | 2 +- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 621de8a0e4..62b5b2306d 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -395,14 +395,6 @@ OpenLayers.Map = OpenLayers.Class({ * the popup from getting too close to the map border. */ 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 @@ -508,9 +500,6 @@ OpenLayers.Map = OpenLayers.Class({ } OpenLayers.Element.addClass(this.div, 'olMap'); - if (this.tileAnimation) { - OpenLayers.Element.addClass(this.div, 'olMapTileAnim'); - } // the viewPortDiv is the outermost div we modify var id = this.id + "_OpenLayers_ViewPort"; diff --git a/tests/Layer/Image.html b/tests/Layer/Image.html index 4d4219284f..05ab5c378f 100644 --- a/tests/Layer/Image.html +++ b/tests/Layer/Image.html @@ -128,7 +128,7 @@ function test_loadEvents(t) { t.plan(3); - var map = new OpenLayers.Map('map', {tileAnimation: false}); + var map = new OpenLayers.Map('map'); var layer = new OpenLayers.Layer.Image( 'Test', '../../img/blank.gif', new OpenLayers.Bounds(-180, -88.759, 180, 88.759), diff --git a/tests/Map.html b/tests/Map.html index 4f2c37b656..faad0b30c7 100644 --- a/tests/Map.html +++ b/tests/Map.html @@ -115,24 +115,6 @@ 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) { t.plan(2); map = new OpenLayers.Map('map', {maxExtent: new OpenLayers.Bounds(100, 200, 300, 400)}); diff --git a/theme/default/style.css b/theme/default/style.css index 64bec7d29c..c695689ff7 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -433,7 +433,7 @@ span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { * Animations */ -.olMapTileAnim .olTileImage { +.olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; From f2168d13b7559d487afe5de8e9ea08eb581420da Mon Sep 17 00:00:00 2001 From: tschaub Date: Mon, 2 Jan 2012 16:07:40 -0700 Subject: [PATCH 2/2] Increase timeout to avoid flashes. Without this change, flashes are fairly frequent while zooming around a full screen map. --- examples/fullScreen.html | 6 +++--- examples/fullScreen.js | 32 +++++++++++++++++++------------- lib/OpenLayers/Layer/Grid.js | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/fullScreen.html b/examples/fullScreen.html index 7a92debd56..f5df04a21f 100644 --- a/examples/fullScreen.html +++ b/examples/fullScreen.html @@ -25,9 +25,8 @@ } - - +
@@ -38,7 +37,7 @@

- Demonstrate a map that fill the entire browser window. + Demonstrate a map that fills the entire browser window.

@@ -48,6 +47,7 @@ fullScreen.js source to see how this is done.

+ diff --git a/examples/fullScreen.js b/examples/fullScreen.js index 93ed57a027..e2ad311d19 100644 --- a/examples/fullScreen.js +++ b/examples/fullScreen.js @@ -1,15 +1,21 @@ -var map; -function init(){ - map = new OpenLayers.Map('map'); +var urls = [ + "http://a.tile.openstreetmap.org/${z}/${x}/${y}.png", + "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", - "http://vmap0.tiles.osgeo.org/wms/vmap0", - {layers: 'basic'} ); - var ol_wms_nobuffer = new OpenLayers.Layer.WMS( "OpenLayers WMS (no tile buffer)", - "http://vmap0.tiles.osgeo.org/wms/vmap0", - {layers: 'basic'}, {buffer: 0}); +var map = new OpenLayers.Map({ + div: "map", + layers: [ + new OpenLayers.Layer.XYZ("OSM (with buffer)", urls, { + transitionEffect: "resize", buffer: 2, sphericalMercator: true + }), + 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.setCenter(new OpenLayers.LonLat(0, 0), 6); -} +map.addControl(new OpenLayers.Control.LayerSwitcher()); \ No newline at end of file diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index b75edc91f7..976eb674ef 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -549,7 +549,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { window.clearTimeout(this.backBufferTimerId); } this.backBufferTimerId = window.setTimeout( - OpenLayers.Function.bind(this.removeBackBuffer, this), 800); + OpenLayers.Function.bind(this.removeBackBuffer, this), 2500); }, /**