|
@@ -15,11 +15,20 @@
|
|
|
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
|
|
|
|
|
|
<script>
|
|
|
- var map = L.map('map').setView([48.9547, 10.9083], 16);
|
|
|
+ var hydranten = new L.LayerGroup();
|
|
|
+
|
|
|
+ var osm = L.tileLayer(
|
|
|
+ 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
|
|
|
+ {
|
|
|
+ attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ var baseLayers = {
|
|
|
+ 'OSM': osm,
|
|
|
+ };
|
|
|
+
|
|
|
|
|
|
- L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
|
|
- attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
|
|
- }).addTo(map);
|
|
|
|
|
|
function onEachFeature(feature, layer) {
|
|
|
var popupContent = "<p>" + feature.geometry.type + "</p>";
|
|
@@ -31,19 +40,11 @@
|
|
|
layer.bindPopup(popupContent);
|
|
|
}
|
|
|
|
|
|
- L.geoJson(regions, {
|
|
|
+
|
|
|
+ hypois = L.geoJson(regions, {
|
|
|
|
|
|
style: function (feature) {
|
|
|
st = { weight: 1, color: "#000", opacity: 1, fillColor: "#ff0", fillOpacity: 0.5 }
|
|
|
-
|
|
|
- if(feature.properties.done) {
|
|
|
- st["fillColor"] = "#dc0067";
|
|
|
- }
|
|
|
-
|
|
|
- if(feature.properties.outdoor) {
|
|
|
- st["weight"] = 0;
|
|
|
- }
|
|
|
-
|
|
|
return st
|
|
|
},
|
|
|
|
|
@@ -59,8 +60,24 @@
|
|
|
fillOpacity: 0.8
|
|
|
});
|
|
|
}
|
|
|
- }).addTo(map);
|
|
|
+ }).addTo(hydranten)
|
|
|
+
|
|
|
+ var overlays = {
|
|
|
+ "Hydranten": hydranten
|
|
|
+ };
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+ var map = L.map('map',
|
|
|
+ {
|
|
|
+ center: [48.9547, 10.9083],
|
|
|
+ zoom: 16,
|
|
|
+ layers: [osm, hydranten],
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ L.control.layers(baseLayers, overlays).addTo(map);
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|
|
|
+
|