testing to remove route button -> search will be automatical on lost
focus
This commit is contained in:
parent
441146eeae
commit
879d73c629
@ -82,8 +82,8 @@ OSRM.Localization["en"] = {
|
||||
//gui
|
||||
"GUI_START": "Start",
|
||||
"GUI_END": "End",
|
||||
"GUI_RESET": "Reset",
|
||||
"GUI_SEARCH": "Search",
|
||||
"GUI_RESET": " Reset ",
|
||||
"GUI_SEARCH": " Search ",
|
||||
"GUI_ROUTE": "Route",
|
||||
"GUI_REVERSE": "Reverse",
|
||||
"GUI_OPTIONS": "Options",
|
||||
|
@ -37,6 +37,11 @@ function updateLocation(marker_id) {
|
||||
|
||||
// process input request and call geocoder if needed
|
||||
function callGeocoder(marker_id, query) {
|
||||
if (marker_id == OSRM.SOURCE_MARKER_LABEL && my_markers.route[0] && my_markers.route[0].label == OSRM.SOURCE_MARKER_LABEL && my_markers.route[0].dirty == false)
|
||||
return;
|
||||
if (marker_id == OSRM.TARGET_MARKER_LABEL && my_markers.route[my_markers.route.length-1] && my_markers.route[my_markers.route.length-1].label == OSRM.TARGET_MARKER_LABEL && my_markers.route[my_markers.route.length-1].dirty == false)
|
||||
return;
|
||||
|
||||
//geo coordinates given -> go directly to drawing results
|
||||
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
||||
var coord = query.split(/[,;]/);
|
||||
|
@ -88,16 +88,18 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
||||
<table class="full">
|
||||
<tr>
|
||||
<td id="gui-search-source-label">Start:</td>
|
||||
<td><input id="input-source-name" class="input-box" type="text" maxlength="200" value="" title="Startposition eingeben" onkeypress="if(event.keyCode==13) {callGeocoder(OSRM.SOURCE_MARKER_LABEL, document.getElementById('input-source-name').value);}" /></td>
|
||||
<td><input id="input-source-name" class="input-box" type="text" maxlength="200" value="" title="Startposition eingeben" onchange="if( my_markers.route[0] && my_markers.route[0].label == OSRM.SOURCE_MARKER_LABEL) my_markers.route[0].dirty = true;" onblur="callGeocoder(OSRM.SOURCE_MARKER_LABEL, document.getElementById('input-source-name').value);" onkeypress="if(event.keyCode==13) {callGeocoder(OSRM.SOURCE_MARKER_LABEL, document.getElementById('input-source-name').value);}" /></td>
|
||||
<!-- <td class="right"><a class="button not-selectable" id="gui-here-target" onclick="">i</a></td> -->
|
||||
<td class="right"><a class="button not-selectable" id="gui-search-source" onclick="callGeocoder(OSRM.SOURCE_MARKER_LABEL, document.getElementById('input-source-name').value);">Suchen</a></td>
|
||||
<!-- <td class="right"><a class="button not-selectable" id="gui-search-source" onclick="callGeocoder(OSRM.SOURCE_MARKER_LABEL, document.getElementById('input-source-name').value);">Suchen</a></td> -->
|
||||
<td class="right"><a class="button not-selectable" id="gui-search-source" onclick="">Suchen</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td id="gui-search-target-label">Ende:</td>
|
||||
<td><input id="input-target-name" class="input-box" type="text" maxlength="200" value="" title="Zielposition eingeben" onkeypress="if(event.keyCode==13) {callGeocoder(OSRM.TARGET_MARKER_LABEL, document.getElementById('input-target-name').value);}" /></td>
|
||||
<td><input id="input-target-name" class="input-box" type="text" maxlength="200" value="" title="Zielposition eingeben" onchange="if( my_markers.route[my_markers.route.length-1] && my_markers.route[my_markers.route.length-1].label == OSRM.TARGET_MARKER_LABEL) my_markers.route[my_markers.route.length-1].dirty = true;" onblur="callGeocoder(OSRM.TARGET_MARKER_LABEL, document.getElementById('input-target-name').value);" onkeypress="if(event.keyCode==13) {callGeocoder(OSRM.TARGET_MARKER_LABEL, document.getElementById('input-target-name').value);}" /></td>
|
||||
<!-- <td class="right"><a class="button not-selectable" id="gui-here-target" onclick="">i</a></td> -->
|
||||
<td class="right"><a class="button not-selectable" id="gui-search-target" onclick="callGeocoder(OSRM.TARGET_MARKER_LABEL, document.getElementById('input-target-name').value);">Suchen</a></td>
|
||||
<!-- <td class="right"><a class="button not-selectable" id="gui-search-target" onclick="callGeocoder(OSRM.TARGET_MARKER_LABEL, document.getElementById('input-target-name').value);">Suchen</a></td> -->
|
||||
<td class="right"><a class="button not-selectable" id="gui-search-target" onclick="">Suchen</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -106,8 +108,11 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<td> <a class="button not-selectable" id="gui-reset" onclick="resetRouting();">Reset</a></td>
|
||||
<!--
|
||||
<td class="center"> <a class="button not-selectable" id="gui-reverse" onclick="reverseRouting();">Reverse</a></td>
|
||||
<td class="right"> <a class="button not-selectable" id="gui-route" onclick="startRouting();">Route</a></td>
|
||||
-->
|
||||
<td class="right"> <a class="button not-selectable" id="gui-reverse" onclick="reverseRouting();">Reverse</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -67,7 +67,7 @@ function prefetchIcons() {
|
||||
|
||||
// init localization
|
||||
function initLocale() {
|
||||
document.getElementById("gui-route").innerHTML = OSRM.loc("GUI_ROUTE");
|
||||
// document.getElementById("gui-route").innerHTML = OSRM.loc("GUI_ROUTE");
|
||||
document.getElementById("gui-reset").innerHTML = OSRM.loc("GUI_RESET");
|
||||
document.getElementById("gui-reverse").innerHTML = OSRM.loc("GUI_REVERSE");
|
||||
document.getElementById("gui-option-highlight-nonames-label").innerHTML = OSRM.loc("GUI_HIGHLIGHT_UNNAMED_ROADS");
|
||||
|
Loading…
Reference in New Issue
Block a user