Browse Source

Initialer Commit, erste Hydranten

Sven Velt 8 years ago
commit
2a0c8f6d26
4 changed files with 318 additions and 0 deletions
  1. 3 0
      .gitignore
  2. 20 0
      Datafiles/Hydranten-TR.csv
  3. 66 0
      index.html
  4. 229 0
      tr-hydrant.js

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+*.sw*
+*~
+

+ 20 - 0
Datafiles/Hydranten-TR.csv

@@ -0,0 +1,20 @@
+1 48.95774682 10.90498822
+2 48.95776290 10.90573634
+3 48.95732022 10.90423397
+4 48.95671018 10.90574818
+5 48.95745688 10.90644815
+6 48.95684525 10.90625499
+7 48.95751713 10.90745931
+8 48.95732239 10.90738798
+9 48.95675401 10.90726092
+10 48.95806077 10.90366836
+11 48.95832714 10.90364483
+12 48.95824036 10.90486687
+13 48.95832596 10.90642702
+14 48.95647900 10.90504841
+15 48.95834103 10.90894643
+16 48.95769448 10.90871705
+17 48.95709856 10.90814975
+18 48.95694097 10.90878843
+19 48.95622614 10.90876166
+20 48.95611598 10.90778709

+ 66 - 0
index.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<title>Leaflet GeoJSON Example</title>
+	<meta charset="utf-8" />
+
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
+</head>
+<body>
+	<div id="map" style="width: 1200px; height: 700px"></div>
+
+	<script src="tr-hydrant.js" type="text/javascript"></script>
+	<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);
+
+		L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
+			attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
+		}).addTo(map);
+
+		function onEachFeature(feature, layer) {
+			var popupContent = "<p>" + feature.geometry.type + "</p>";
+
+			if (feature.properties && feature.properties.popupContent) {
+				popupContent += feature.properties.popupContent;
+			}
+
+			layer.bindPopup(popupContent);
+		}
+
+		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
+			},
+
+			onEachFeature: onEachFeature,
+
+			pointToLayer: function (feature, latlng) {
+				return L.circleMarker(latlng, {
+					radius: 8,
+					fillColor: "#ff7800",
+					color: "#000",
+					weight: 1,
+					opacity: 1,
+					fillOpacity: 0.8
+				});
+			}
+		}).addTo(map);
+
+	</script>
+</body>
+</html>

+ 229 - 0
tr-hydrant.js

@@ -0,0 +1,229 @@
+var regions = {
+	"type": "FeatureCollection",
+	"features": [
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "1",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90498822, 48.95774682 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "2",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90573634, 48.95776290 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "3",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90423397, 48.95732022 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "4",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90574818, 48.95671018 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "5",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90644815, 48.95745688 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "6",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90625499, 48.95684525 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "7",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90745931, 48.95751713 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "8",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90738798, 48.95732239 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "9",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90726092, 48.95675401 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "10",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90366836, 48.95806077 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "11",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90364483, 48.95832714 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "12",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90486687, 48.95824036 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "13",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90642702, 48.95832596 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "14",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90504841, 48.95647900 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "15",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90894643, 48.95834103 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "16",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90871705, 48.95769448 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "17",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90814975, 48.95709856 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "18",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90878843, 48.95694097 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "19",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90876166, 48.95622614 ]
+			}
+		},
+
+		{
+			"type": "Feature",
+			"properties": {
+				"popupContent": "20",
+			},
+			"geometry": {
+				"type": "Point",
+				"coordinates": [ 10.90778709, 48.95611598 ]
+			}
+		},
+
+
+	],
+};
+
+