diff --git a/CHANGELOG b/CHANGELOG
index 762705a..4cc8a11 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,7 @@
* #28 Fightdedection Plygon on Map
* #27 Draw Camera-Desity bock on map
* #16 filter nach kategorien/tracker einbauen
+* #15 suche nach ständen einbauen
### Bugfixes
* Add Correct Dispose Handling
* TimeCalculation now handle negative values correct
diff --git a/Lora-Map/Lora-Map.csproj b/Lora-Map/Lora-Map.csproj
index af91716..216558a 100644
--- a/Lora-Map/Lora-Map.csproj
+++ b/Lora-Map/Lora-Map.csproj
@@ -111,6 +111,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
diff --git a/Lora-Map/resources/css/global.css b/Lora-Map/resources/css/global.css
index 3a8d345..57a9bff 100644
--- a/Lora-Map/resources/css/global.css
+++ b/Lora-Map/resources/css/global.css
@@ -74,6 +74,9 @@ object {
#menucollumn .weather.ac {
background-image: url("icons/storm-ac.png");
}
+#menucollumn .suche {
+ background-image: url("icons/search.png");
+}
#pannels {
position: absolute;
@@ -271,6 +274,48 @@ object {
width: 235px;
}
+#pannels #pannels_suche {
+ display: none;
+ padding: 5px;
+}
+#pannels #pannels_suche .searchtitle {
+ font-weight: bold;
+ font-size: 13px;
+}
+#pannels #pannels_suche input {
+ width: 220px;
+ margin-top: 5px;
+}
+#pannels #pannels_suche #search_results {
+ border-top: 1px solid black;
+ margin-top: 10px;
+ padding-top: 10px;
+}
+#pannels #pannels_suche #search_results .result {
+ background-color: rgba(0,0,0,0.2);
+ margin-bottom: 5px;
+ cursor: pointer;
+}
+#pannels #pannels_suche #search_results .result .text {
+ display: inline-block;
+ width: 200px;
+}
+#pannels #pannels_suche #search_results .result .text .title {
+ font-weight: bold;
+ display: block;
+}
+#pannels #pannels_suche #search_results .result .text .desc {
+ display: block;
+}
+#pannels #pannels_suche #search_results .result .box {
+ display: inline-block;
+ height: 25px;
+ width: 15px;
+ border-style: solid;
+ border-width: 2px;
+ vertical-align: top;
+}
+
#overlays #cameracount {
position: absolute;
top: 10px;
diff --git a/Lora-Map/resources/css/icons/search.png b/Lora-Map/resources/css/icons/search.png
new file mode 100644
index 0000000..2c622d0
Binary files /dev/null and b/Lora-Map/resources/css/icons/search.png differ
diff --git a/Lora-Map/resources/index.html b/Lora-Map/resources/index.html
index 0c26246..90f4854 100644
--- a/Lora-Map/resources/index.html
+++ b/Lora-Map/resources/index.html
@@ -12,6 +12,7 @@
+
diff --git a/Lora-Map/resources/js/map.js b/Lora-Map/resources/js/map.js
index 2a08bf0..cb821fd 100644
--- a/Lora-Map/resources/js/map.js
+++ b/Lora-Map/resources/js/map.js
@@ -1,5 +1,6 @@
var MapObject = {
Map: {},
+ GeoJson: {},
_FightDedection: {},
_DensityAreas: {},
_SpecialMarkers: new Array(),
@@ -77,7 +78,7 @@
var box = this._FightDedection[cameraid];
var diff = FunctionsObject.TimeCalculation(fight["LastUpdate"], "diffraw");
if (diff <= 10 && box.options.color === "black") {
- box.setStyle({ color: 'rgb(' + fight["FightProbability"]*255+',0,0)' });
+ box.setStyle({ color: 'rgb(' + fight["FightProbability"] * 255 + ',0,0)' });
} else if (diff <= 10 && box.options.color !== "black") {
if (diff % 2 === 0) {
box.setStyle({ color: 'rgb(' + fight["FightProbability"] * 255 + ',0,0)' });
@@ -120,6 +121,7 @@
},
_ParseAJAXGeo: function (geo) {
if (!(Object.keys(geo).length === 0 && geo.constructor === Object)) {
+ this.GeoJson = geo;
L.geoJSON(geo, {
style: function (features) {
return {
@@ -254,5 +256,8 @@
},
_HidePanel: function (e) {
MenuObject.ShowHidePanel(null);
+ },
+ JumpTo: function (lat, lon) {
+ this.Map.flyTo([lat, lon], 19);
}
}.Start();
\ No newline at end of file
diff --git a/Lora-Map/resources/js/menu.js b/Lora-Map/resources/js/menu.js
index a72cf85..62a2249 100644
--- a/Lora-Map/resources/js/menu.js
+++ b/Lora-Map/resources/js/menu.js
@@ -197,5 +197,23 @@
document.getElementById("pannels_weather").innerHTML = "
Keine Gefahren
";
document.getElementById("menucol_weather_icon").className = "weather";
}
+ },
+ SearchInGeoJson: function (searchtext) {
+ var html = "";
+ if (MapObject.GeoJson.features.length > 0) {
+ for (var i = 0; i < MapObject.GeoJson.features.length; i++) {
+ var feature = MapObject.GeoJson.features[i];
+ if (feature.properties.name.indexOf(searchtext) !== -1 && feature.geometry.type === "Polygon") {
+ if (feature.geometry.coordinates.length > 0 && feature.geometry.coordinates[0].length > 0 && feature.geometry.coordinates[0][0].length > 0) {
+ html += "
" +
+ "" + feature.properties.name + "" +
+ "" + (typeof feature.properties.description !== "undefined" ? feature.properties.description : "") + "" +
+ "" +
+ "
";
+ }
+ }
+ }
+ }
+ document.getElementById("search_results").innerHTML = html;
}
}.Start();
\ No newline at end of file