Searchfunction case insensitive

This commit is contained in:
Philip Schell 2019-09-02 16:03:49 +02:00
parent 69e1ff73b0
commit cec861cd7c
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
### Bugfixes
### Changes
* Change Online Map MaxZoom to 19
* Searchfunction case insensitive
## 1.2.9
### New Features

View File

@ -203,7 +203,7 @@
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.properties.name.toLowerCase().indexOf(searchtext.toLowerCase()) !== -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 += "<div class='result' onclick='MapObject.JumpTo(" + feature.geometry.coordinates[0][0][1] + "," + feature.geometry.coordinates[0][0][0]+");'><span class='text'>" +
"<span class='title'>" + feature.properties.name + "</span>" +