make canvas be underneath svg by default

This commit is contained in:
Vladimir Agafonkin 2013-12-16 19:04:07 -05:00
parent 7bffd4924b
commit 65ae546fa0
2 changed files with 8 additions and 5 deletions

View File

@ -24,16 +24,16 @@
var canvas = L.canvas(); var canvas = L.canvas();
var path = L.polygon([
[route, [[50.5, 30.5], [50.5, 40], [40, 40]]],
[[[20, 0], [20, 40], [0, 40]]]
], {renderer: canvas}).addTo(map).bindPopup('Hello Canvas');
var poly = L.polyline([ var poly = L.polyline([
[[60, 30], [60, 50], [40, 50]], [[60, 30], [60, 50], [40, 50]],
[[20, 50], [20, 70], [0, 70]] [[20, 50], [20, 70], [0, 70]]
], {color: 'red'}).addTo(map).bindPopup('Hello SVG'); ], {color: 'red'}).addTo(map).bindPopup('Hello SVG');
var path = L.polygon([
[route, [[50.5, 30.5], [50.5, 40], [40, 40]]],
[[[20, 0], [20, 40], [0, 40]]]
], {renderer: canvas}).addTo(map).bindPopup('Hello Canvas');
var circle = L.circle([35, 0], 700000, {color: 'green', renderer: canvas}).addTo(map).bindPopup('Hello Circle'); var circle = L.circle([35, 0], 700000, {color: 'green', renderer: canvas}).addTo(map).bindPopup('Hello Circle');
var circleMarker = L.circleMarker([35, 30], {color: 'magenta', radius: 30}).addTo(map); var circleMarker = L.circleMarker([35, 30], {color: 'magenta', radius: 30}).addTo(map);

3
dist/leaflet.css vendored
View File

@ -66,6 +66,9 @@
.leaflet-marker-pane { z-index: 6; } .leaflet-marker-pane { z-index: 6; }
.leaflet-popup-pane { z-index: 7; } .leaflet-popup-pane { z-index: 7; }
.leaflet-map-pane canvas { z-index: 1; }
.leaflet-map-pane svg { z-index: 2; }
.leaflet-vml-shape { .leaflet-vml-shape {
width: 1px; width: 1px;
height: 1px; height: 1px;