Skip to content
Snippets Groups Projects
Commit b11b4e6c authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

MetaGer Suche sucht nun ebenfalls nach der Adresse

parent b700cd9d
No related branches found
No related tags found
No related merge requests found
Showing
with 216 additions and 39 deletions
...@@ -1116,6 +1116,11 @@ function deinitSearchBox() { ...@@ -1116,6 +1116,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1584,8 +1589,16 @@ function buildResultFromData(data){ ...@@ -1584,8 +1589,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
...@@ -2239,7 +2252,32 @@ function generatePreviewRoute() { ...@@ -2239,7 +2252,32 @@ function generatePreviewRoute() {
countLoggedWaypoints++; countLoggedWaypoints++;
} }
}); });
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
if (countLoggedWaypoints < 2 ) { if (countLoggedWaypoints < 2 ) {
if(countLoggedWaypoints === 1){
// Let's Zoom into this point
var point = null;
$.each(waypoints, function(index, value){
if(value !== ""){
point = value;
return false;
}
});
if(point === "gps"){
point = gpsLocation;
}
point = ol.proj.transform(point, 'EPSG:4326', 'EPSG:3857');
map.getView().animate({
center: point,
zoom: 15,
duration: 1500,
padding: [5, paddingRight, 5, 5]
});
}
return; return;
} else { } else {
var points = ""; var points = "";
...@@ -2298,14 +2336,9 @@ function generatePreviewRoute() { ...@@ -2298,14 +2336,9 @@ function generatePreviewRoute() {
} }
} }
   
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
map.getView().fit(geom, { map.getView().fit(geom, {
duration: 1500, duration: 1500,
padding: [5, (paddingRight + 5), 5, 6], padding: [5, (paddingRight + 20), 5, 6],
maxZoom: 18, maxZoom: 18,
}); });
}); });
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
"css/mapSearch.css": "css/mapSearch-dc23b3b185.css", "css/mapSearch.css": "css/mapSearch-dc23b3b185.css",
"css/routing.css": "css/routing-fb5c827870.css", "css/routing.css": "css/routing-fb5c827870.css",
"css/staticPages.css": "css/staticPages-ca78145b6f.css", "css/staticPages.css": "css/staticPages-ca78145b6f.css",
"js/findRoute.js": "js/findRoute-db30f2da04.js", "js/findRoute.js": "js/findRoute-8d402a90eb.js",
"js/iframeSearch.js": "js/iframeSearch-f5cb955148.js", "js/iframeSearch.js": "js/iframeSearch-e1a3c8d9d1.js",
"js/mapSearch.js": "js/mapSearch-c183a4ddf6.js", "js/mapSearch.js": "js/mapSearch-726faa28ef.js",
"js/routing.js": "js/routing-116e0559a2.js" "js/routing.js": "js/routing-9e6c7cc601.js"
} }
\ No newline at end of file
...@@ -1116,6 +1116,11 @@ function deinitSearchBox() { ...@@ -1116,6 +1116,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1584,8 +1589,16 @@ function buildResultFromData(data){ ...@@ -1584,8 +1589,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
...@@ -2239,7 +2252,32 @@ function generatePreviewRoute() { ...@@ -2239,7 +2252,32 @@ function generatePreviewRoute() {
countLoggedWaypoints++; countLoggedWaypoints++;
} }
}); });
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
if (countLoggedWaypoints < 2 ) { if (countLoggedWaypoints < 2 ) {
if(countLoggedWaypoints === 1){
// Let's Zoom into this point
var point = null;
$.each(waypoints, function(index, value){
if(value !== ""){
point = value;
return false;
}
});
if(point === "gps"){
point = gpsLocation;
}
point = ol.proj.transform(point, 'EPSG:4326', 'EPSG:3857');
map.getView().animate({
center: point,
zoom: 15,
duration: 1500,
padding: [5, paddingRight, 5, 5]
});
}
return; return;
} else { } else {
var points = ""; var points = "";
...@@ -2298,14 +2336,9 @@ function generatePreviewRoute() { ...@@ -2298,14 +2336,9 @@ function generatePreviewRoute() {
} }
} }
   
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
map.getView().fit(geom, { map.getView().fit(geom, {
duration: 1500, duration: 1500,
padding: [5, (paddingRight + 5), 5, 6], padding: [5, (paddingRight + 20), 5, 6],
maxZoom: 18, maxZoom: 18,
}); });
}); });
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -1098,6 +1098,11 @@ function deinitSearchBox() { ...@@ -1098,6 +1098,11 @@ function deinitSearchBox() {
   
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
   
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){ ...@@ -1566,8 +1571,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
   
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
   
......
This diff is collapsed.
...@@ -383,7 +383,32 @@ function generatePreviewRoute() { ...@@ -383,7 +383,32 @@ function generatePreviewRoute() {
countLoggedWaypoints++; countLoggedWaypoints++;
} }
}); });
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
if (countLoggedWaypoints < 2 ) { if (countLoggedWaypoints < 2 ) {
if(countLoggedWaypoints === 1){
// Let's Zoom into this point
var point = null;
$.each(waypoints, function(index, value){
if(value !== ""){
point = value;
return false;
}
});
if(point === "gps"){
point = gpsLocation;
}
point = ol.proj.transform(point, 'EPSG:4326', 'EPSG:3857');
map.getView().animate({
center: point,
zoom: 15,
duration: 1500,
padding: [5, paddingRight, 5, 5]
});
}
return; return;
} else { } else {
var points = ""; var points = "";
...@@ -442,14 +467,9 @@ function generatePreviewRoute() { ...@@ -442,14 +467,9 @@ function generatePreviewRoute() {
} }
} }
// We give adjust the view so the route is not under the result list
paddingRight = 0;
if(parseInt( $(document).outerWidth()) > 768 && $("#results").attr("data-status") === "out" ){
paddingRight = $("#search-addon").outerWidth();
}
map.getView().fit(geom, { map.getView().fit(geom, {
duration: 1500, duration: 1500,
padding: [5, (paddingRight + 5), 5, 6], padding: [5, (paddingRight + 20), 5, 6],
maxZoom: 18, maxZoom: 18,
}); });
}); });
......
...@@ -78,6 +78,11 @@ function deinitSearchBox() { ...@@ -78,6 +78,11 @@ function deinitSearchBox() {
function initStartNavigation() { function initStartNavigation() {
$("#start-navigation").removeClass("hidden"); $("#start-navigation").removeClass("hidden");
if(gps){
$("#start-navigation > a").attr("href", "/route/start/foot/gps;")
}else{
$("#start-navigation > a").attr("href", "/route/start/foot")
}
} }
function deinitStartNavigation() { function deinitStartNavigation() {
...@@ -546,8 +551,16 @@ function buildResultFromData(data){ ...@@ -546,8 +551,16 @@ function buildResultFromData(data){
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\">Route berechnen</a>';
// And the Link to the MetaGer Search // And the Link to the MetaGer Search
// build the search query
var query = "";
if(typeof data["namedetails"]["name"] !== "undefined"){ if(typeof data["namedetails"]["name"] !== "undefined"){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(data["namedetails"]["name"]) + '&encoding=utf8&lang=all'; query += data["namedetails"]["name"];
}
query += " " + road;
query += " " + city;
query = query.trim();
if(query.length > 0){
var url = 'https://metager.de/meta/meta.ger3?focus=web&eingabe=' + encodeURIComponent(query) + '&encoding=utf8&lang=all';
html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>'; html += '<a href=\"'+url+'\" class=\"btn btn-default btn-xs\" target=_blank>MetaGer Suche</a>';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment