diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 23915f77eb6b24b3a9ee209de38caf6494d00609..58c1f6a5aadbea719dd33f2fd4a64a94d8df0fc8 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -37,6 +37,7 @@ public function boundingBoxSearch($search, $latMin, $lonMin, $latMax, $lonMax, $ $tmp["boundingbox"] = $result["boundingbox"]; $tmp["geojson"] = $result["geojson"]; $tmp["huerotate"] = hexdec(substr(md5(serialize($result)), 0, 5)) % 360; + $tmp["place_id"] = $result["place_id"]; $searchResults[] = $tmp; } diff --git a/resources/views/searchResults.blade.php b/resources/views/searchResults.blade.php index c995e097281466178e9602d2605e739c889715f3..656139d5b139b08278340a8b1e130063fcb0af66 100644 --- a/resources/views/searchResults.blade.php +++ b/resources/views/searchResults.blade.php @@ -55,7 +55,7 @@ $.each(searchResults, function(index, value) { opening_hours = opening_hours.replace(/;/g, ",<br />"); population = typeof value["extratags"]["population"] !== 'undefined' ? " (" + numberWithPoints(value["extratags"]["population"]) + " Einwohner)" : ""; } - var res = $("<div class=\"result col-xs-12\" id=\"result-"+index+"\"><div class=\"col-xs-2\"><span class=\"marker\" style=\"filter: hue-rotate("+value["huerotate"]+"deg);\">"+index+"</span></div>" + "<div class=\"col-xs-10\"><p class=\"title\">" + value["title"] + "</p>" + "<p class=\"type\">" + type + population + "</p>" + "<p class=\"address\">" + road + " " + house_number + "</p><p class=\"city\">" + city + "</p>" + "<p class=\"opening-hours\">" + opening_hours + "</p>" + "<p class=\"tags\">" + "</p></div></div>"); + var res = $("<div class=\"result col-xs-12\" id=\"result-"+index+"\"><div class=\"col-xs-2\"><span class=\"marker\" style=\"filter: hue-rotate("+value["huerotate"]+"deg);\">"+index+"</span></div>" + "<div class=\"col-xs-10\"><p class=\"title\">" + value["title"] + "</p>" + "<p class=\"type\">" + type + population + "</p>" + "<p class=\"address\">" + road + " " + house_number + "</p><p class=\"city\">" + city + "</p>" + "<p class=\"opening-hours\">" + opening_hours + "</p>" + "<p class=\"tags\">" + "</p><a href=\"https://maps.metager.de/nominatim/details.php?place_id="+value["place_id"]+"\" target=\"_blank\" class=\"btn btn-default btn-xs\">Details</a></div></div>"); var resPopup = $("<div class=\"result col-xs-12\"> " + "<p class=\"title\">" + value["title"] + "</p>" + "<p class=\"type\">" + type + population + "</p>" + "<p class=\"address\">" + road + " " + house_number + "</p><p class=\"city\">" + city + "</p>" + "<p class=\"opening-hours\">" + opening_hours + "</p>" + "<p class=\"tags\">" + "</p>" + "</div>"); $("#results").append(res); el.click(function(evt){