Le calque pbf est toujours au dessus du fond
This commit is contained in:
1 parent
2093a584bb
commit
19237c36a2
1 file changed
+17
@@ -43,6 +43,13 @@ $(document).ready(function() {
|
||||
layers: [topo_maptiler]
|
||||
}).setView([47, 3], 6);
|
||||
|
||||
// Pane dédiée pour les vector tiles, au-dessus du fond
|
||||
if (!mymap.getPane('vectorPane')) {
|
||||
mymap.createPane('vectorPane');
|
||||
mymap.getPane('vectorPane').style.zIndex = 650;
|
||||
mymap.getPane('vectorPane').style.pointerEvents = 'auto';
|
||||
}
|
||||
|
||||
$("#map-credits").html(topo_maptiler.getAttribution());
|
||||
|
||||
poiLayer = L.layerGroup().addTo(mymap);
|
||||
@@ -101,6 +108,7 @@ $(document).ready(function() {
|
||||
{
|
||||
maxZoom: 9,
|
||||
rendererFactory: L.svg.tile,
|
||||
pane: 'vectorPane',
|
||||
vectorTileLayerStyles: {
|
||||
pois: function(properties, zoom) {
|
||||
var icon = buildPoiVectorIcon(properties);
|
||||
@@ -183,6 +191,15 @@ $(document).ready(function() {
|
||||
$("#map-credits").html(
|
||||
e.layer.getAttribution()
|
||||
);
|
||||
|
||||
if (mymap.hasLayer(vectorLayer)) {
|
||||
if (vectorLayer.bringToFront) {
|
||||
vectorLayer.bringToFront();
|
||||
} else {
|
||||
mymap.removeLayer(vectorLayer);
|
||||
mymap.addLayer(vectorLayer);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user