From f870417a3070e315d15f545bd523e131e1405b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 3 Apr 2012 06:28:06 +0200 Subject: [PATCH 1/3] class name olLayerGridTile renamed olLayerGrid --- examples/style.mobile.css | 2 +- lib/OpenLayers/Layer/Grid.js | 6 +++--- notes/2.12.md | 2 +- tests/Layer/Grid.html | 6 +++--- theme/default/style.css | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/style.mobile.css b/examples/style.mobile.css index 1b7244d420..6854e32fe1 100644 --- a/examples/style.mobile.css +++ b/examples/style.mobile.css @@ -43,7 +43,7 @@ div.olControlZoom a:hover { background: rgba(0, 60, 136, 0.5); } } -.olLayerGridTile .olTileImage { +.olLayerGrid .olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index 4e04e4117d..5c3c46d4e3 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -211,14 +211,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * {String} Name of the class added to the layer div. If not set in the * options passed to the constructor then className defaults to * "olLayerGridSingleTile" for single tile layers (see ), - * and "olLayerGridTile" for non single tile layers. + * and "olLayerGrid" for non single tile layers. * * Note: * * The displaying of tiles is not animated by default for single tile * layers - OpenLayers' default theme (style.css) includes this: * (code) - * .olLayerGridTile .olTileImage { + * .olLayerGrid .olTileImage { * -webkit-transition: opacity 0.2s linear; * -moz-transition: opacity 0.2s linear; * -o-transition: opacity 0.2s linear; @@ -291,7 +291,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { if (this.className === null) { this.className = this.singleTile ? 'olLayerGridSingleTile' : - 'olLayerGridTile'; + 'olLayerGrid'; } if (!OpenLayers.Animation.isNative) { diff --git a/notes/2.12.md b/notes/2.12.md index 875cdb99c9..0ffca1769f 100644 --- a/notes/2.12.md +++ b/notes/2.12.md @@ -63,7 +63,7 @@ Corresponding issues/pull requests: The displaying of tiles can now be animated, using CSS3 transitions. Transitions operate on the `opacity` property. Here's the CSS rule defined in OpenLayers' default theme: - .olLayerGridTile .olTileImage { + .olLayerGrid .olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index 0aa279500c..43791a67cb 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -33,7 +33,7 @@ t.eq( layer.ratio, 1.5, "ratio default is 1.5"); t.eq( layer.numLoadingTiles, 0, "numLoadingTiles starts at 0"); t.ok( layer.tileClass === OpenLayers.Tile.Image, "tileClass default is OpenLayers.Tile.Image"); - t.eq( layer.className, 'olLayerGridTile', "className default is olLayerGridTile"); + t.eq( layer.className, 'olLayerGrid', "className default is olLayerGrid"); t.eq( layer.removeBackBufferDelay, 2500, "removeBackBufferDelay default is 2500"); var obj = {}; @@ -55,8 +55,8 @@ var map = new OpenLayers.Map('map'); layer = new OpenLayers.Layer.Grid(name, url, params, null); map.addLayer(layer); - t.ok(OpenLayers.Element.hasClass(layer.div, "olLayerGridTile"), - "olLayerGridTile class assigned to layer div"); + t.ok(OpenLayers.Element.hasClass(layer.div, "olLayerGrid"), + "olLayerGrid class assigned to layer div"); map.destroy(); } diff --git a/theme/default/style.css b/theme/default/style.css index 16c4a9fa6f..8e0abb70f4 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -476,7 +476,7 @@ a.olControlZoomOut { * Animations */ -.olLayerGridTile .olTileImage { +.olLayerGrid .olTileImage { -webkit-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear; From f2dd130256aae25f601e950a2832b43285648b2e Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 27 Mar 2012 14:34:19 +0200 Subject: [PATCH 2/3] update mapbox example. * use Zoom control instead of ZoomPanel * wrap date line * attribution control already at the bottom of the map * use html entities for the copyright symbol * layer has 17 levels, update numZoomLevels --- examples/mapbox.html | 43 ------------------------------------------- examples/mapbox.js | 9 +++++---- 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/examples/mapbox.html b/examples/mapbox.html index 3ccbffe776..4ccac1434e 100644 --- a/examples/mapbox.html +++ b/examples/mapbox.html @@ -7,49 +7,6 @@ OpenLayers MapBox Example -

Basic MapBox OSM Example

diff --git a/examples/mapbox.js b/examples/mapbox.js index ee57d66e0c..134d0d865e 100644 --- a/examples/mapbox.js +++ b/examples/mapbox.js @@ -6,13 +6,14 @@ var streets = new OpenLayers.Layer.XYZ( "http://c.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png", "http://d.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png" ], { - attribution: "Tiles © MapBox | " + - "Data © OpenStreetMap " + + attribution: "Tiles © MapBox | " + + "Data © OpenStreetMap " + "and contributors, CC-BY-SA", sphericalMercator: true, + wrapDateLine: true, transitionEffect: "resize", buffer: 1, - numZoomLevels: 16 + numZoomLevels: 17 } ); @@ -26,7 +27,7 @@ var map = new OpenLayers.Map({ enableKinetic: true } }), - new OpenLayers.Control.ZoomPanel(), + new OpenLayers.Control.Zoom(), new OpenLayers.Control.Permalink({anchor: true}) ], center: [0, 0], From 2582e762b7142f9cd92706e1a67676878c6dbe84 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 3 Apr 2012 16:49:23 -1000 Subject: [PATCH 3/3] Avoid undefined url. --- lib/OpenLayers/Control/CacheWrite.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Control/CacheWrite.js b/lib/OpenLayers/Control/CacheWrite.js index 5a7a57c565..8b4e787e2f 100644 --- a/lib/OpenLayers/Control/CacheWrite.js +++ b/lib/OpenLayers/Control/CacheWrite.js @@ -173,11 +173,13 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, { try { var canvasContext = tile.getCanvasContext(); if (canvasContext) { + var urlMap = OpenLayers.Control.CacheWrite.urlMap; + var url = urlMap[tile.url] || tile.url; window.localStorage.setItem( - "olCache_" + OpenLayers.Control.CacheWrite.urlMap[tile.url], + "olCache_" + url, canvasContext.canvas.toDataURL(this.imageFormat) ); - delete OpenLayers.Control.CacheWrite.urlMap[tile.url]; + delete urlMap[tile.url]; } } catch(e) { // local storage full or CORS violation