diff --git a/debug/tests/add_remove_layers.html b/debug/tests/add_remove_layers.html index f89e5f9e..b6a10e49 100644 --- a/debug/tests/add_remove_layers.html +++ b/debug/tests/add_remove_layers.html @@ -8,73 +8,8 @@ - - - + @@ -83,5 +18,54 @@ + diff --git a/debug/tests/canvasloop.html b/debug/tests/canvasloop.html index d8a2ed41..6e64c908 100644 --- a/debug/tests/canvasloop.html +++ b/debug/tests/canvasloop.html @@ -1,9 +1,6 @@ - @@ -20,7 +17,8 @@ //Init a map, and attempt a locate. var map = L.map('map', { center: [39.84, -96.591], - zoom: 4 + zoom: 4, + preferCanvas: true }).locate(); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { diff --git a/debug/tests/click_on_canvas.html b/debug/tests/click_on_canvas.html index ac9b21f4..6b20a623 100644 --- a/debug/tests/click_on_canvas.html +++ b/debug/tests/click_on_canvas.html @@ -11,7 +11,6 @@ - - - - - - -
- - diff --git a/debug/vector/vector-canvas.html b/debug/vector/vector-canvas.html index 430ed130..c1749115 100644 --- a/debug/vector/vector-canvas.html +++ b/debug/vector/vector-canvas.html @@ -7,9 +7,6 @@ - @@ -32,7 +29,7 @@ var canvas = L.canvas(); var path = new L.Polyline(latlngs, {renderer: canvas}); - var map = new L.Map('map', {layers: [osm]}); + var map = new L.Map('map', {layers: [osm], preferCanvas: true}); var group = new L.LayerGroup(); diff --git a/src/layer/vector/Renderer.js b/src/layer/vector/Renderer.js index dfb8f624..1c0ac5cd 100644 --- a/src/layer/vector/Renderer.js +++ b/src/layer/vector/Renderer.js @@ -86,7 +86,7 @@ L.Map.include({ var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer; if (!renderer) { - renderer = this._renderer = window.L_PREFER_CANVAS ? L.canvas() : L.svg(); + renderer = this._renderer = (this.options.preferCanvas && L.canvas()) || L.svg(); } if (!this.hasLayer(renderer)) {