UNPKG

leaflet

Version:

JavaScript library for mobile-friendly interactive maps

62 lines (40 loc) 1.68 kB
<!DOCTYPE html> <html> <head> <title>Leaflet debug page</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="stylesheet" href="../css/screen.css" /> <style> </style> <script type="text/javascript" src="../../build/deps.js"></script> <script src="../leaflet-include.js"></script> <script type="text/javascript" src="http://leafletjs.com/examples/eu-countries.js"></script> </head> <body> <div id="map"></div> <script type="text/javascript"> var map = L.map('map'); map.createPane('labels'); // This pane is above markers but below popups map.getPane('labels').style.zIndex = 650; // Layers in this pane are non-interactive and do not obscure mouse/touch events map.getPane('labels').style.pointerEvents = 'none'; var cartodbAttribution = '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'; var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', { attribution: cartodbAttribution }).addTo(map); var positronLabels = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', { attribution: cartodbAttribution, // pane: 'labels' }); var group = L.layerGroup(); group.options.pane = 'labels'; group.addLayer(positronLabels).addTo(map); geojson = L.geoJson(euCountries).addTo(map); geojson.eachLayer(function (layer) { layer.bindPopup(layer.feature.properties.name); }); map.setView({ lat: 47.040182144806664, lng: 9.667968750000002 }, 4); </script> </body> </html>