added GUI support for IE9 and IE10,
changed GUI legal text, changed via-node deletion to click only, moved default entries for input boxes to config file, made input boxes selectable again
This commit is contained in:
parent
dfd3a5d554
commit
0bc3e098ac
@ -6,7 +6,7 @@
|
||||
|
||||
OSRM.Browser = {
|
||||
FF3: useragent.search(/Firefox\/3/),
|
||||
IE6_8: useragent.search(/MSIE (6|7|8)/),
|
||||
IE6_9: useragent.search(/MSIE (6|7|8|9)/),
|
||||
};
|
||||
}());
|
||||
|
||||
|
@ -13,7 +13,7 @@ toggleMain: function() {
|
||||
|
||||
document.getElementById('blob-wrapper').style.visibility="hidden";
|
||||
document.getElementById('main-wrapper').style.left="5px";
|
||||
if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_8!=-1 ) {
|
||||
if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) {
|
||||
getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible";
|
||||
}
|
||||
// hide main-gui
|
||||
@ -23,17 +23,18 @@ toggleMain: function() {
|
||||
getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px";
|
||||
|
||||
document.getElementById('main-wrapper').style.left="-410px";
|
||||
if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_8!=-1 ) {
|
||||
if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) {
|
||||
document.getElementById('blob-wrapper').style.visibility="visible";
|
||||
getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible";
|
||||
}
|
||||
}
|
||||
|
||||
// execute after animation
|
||||
if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_8==-1 ) {
|
||||
if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_9==-1 ) {
|
||||
document.getElementById('main-wrapper').addEventListener("transitionend", OSRM.GUI.onMainTransitionEnd, false);
|
||||
document.getElementById('main-wrapper').addEventListener("webkitTransitionEnd", OSRM.GUI.onMainTransitionEnd, false);
|
||||
document.getElementById('main-wrapper').addEventListener("oTransitionEnd", OSRM.GUI.onMainTransitionEnd, false);
|
||||
document.getElementById('main-wrapper').addEventListener("MSTransitionEnd", OSRM.GUI.onMainTransitionEnd, false);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -26,7 +26,7 @@ OSRM.Localization["de"] = {
|
||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Stra<72>en hervorheben",
|
||||
"GUI_START_TOOLTIP": "Startposition eingeben",
|
||||
"GUI_END_TOOLTIP": "Zielposition eingeben",
|
||||
"GUI_LEGAL_NOTICE": "GUI von Dennis Schieferdecker",
|
||||
"GUI_LEGAL_NOTICE": "GUI2 v0.1 120313 - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.mapquest.com/'>MapQuest</a>",
|
||||
// geocoder
|
||||
"SEARCH_RESULTS": "Suchergebnisse",
|
||||
"TIMED_OUT": "Zeit<69>berschreitung",
|
||||
@ -55,7 +55,7 @@ OSRM.Localization["en"] = {
|
||||
"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets",
|
||||
"GUI_START_TOOLTIP": "Enter start",
|
||||
"GUI_END_TOOLTIP": "Enter destination",
|
||||
"GUI_LEGAL_NOTICE": "GUI by Dennis Schieferdecker",
|
||||
"GUI_LEGAL_NOTICE": "GUI2 v0.1 120313 - OSRM hosting by <a href='http://algo2.iti.kit.edu/'>KIT</a> - Geocoder by <a href='http://www.mapquest.com/'>MapQuest</a>",
|
||||
// geocoder
|
||||
"SEARCH_RESULTS": "Search Results",
|
||||
"TIMED_OUT": "Timed Out",
|
||||
|
@ -74,8 +74,8 @@ OSRM.RouteMarker = function ( label, style, position ) {
|
||||
OSRM.inheritFrom( OSRM.RouteMarker, OSRM.Marker );
|
||||
OSRM.extend( OSRM.RouteMarker, {
|
||||
onClick: function(e) {
|
||||
if(!e.ctrlKey)
|
||||
return;
|
||||
// if(!e.ctrlKey)
|
||||
// return;
|
||||
for( var i=0; i<my_markers.route.length; i++) {
|
||||
if( my_markers.route[i].marker === this ) {
|
||||
my_markers.removeMarker( i );
|
||||
|
@ -8,6 +8,8 @@ OSRM.DEFAULTS = {
|
||||
WEBSITE_URL: 'http://map.project-osrm.org/new/',
|
||||
JSONP_TIMEOUT: 2000,
|
||||
ZOOM_LEVEL: 14,
|
||||
START_LATITUDE: 48.84,
|
||||
START_LONGITUDE: 10.10,
|
||||
ONLOAD_LATITUDE: 48.84,
|
||||
ONLOAD_LONGITUDE: 10.10,
|
||||
ONLOAD_SOURCE: "Karlsruhe",
|
||||
ONLOAD_TARGET: "Aalen",
|
||||
};
|
@ -29,6 +29,7 @@ html, body, #map {
|
||||
-moz-transition:left 1s;
|
||||
-webkit-transition:left 1s;
|
||||
-o-transition:left 1s;
|
||||
-ms-transition:left 1s;
|
||||
}
|
||||
.gui-box
|
||||
{
|
||||
@ -268,7 +269,17 @@ html, body, #map {
|
||||
.not-selectable
|
||||
{
|
||||
cursor:default;
|
||||
-moz-user-select: none;
|
||||
-moz-user-select: -moz-none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.text-selectable
|
||||
{
|
||||
cursor:default;
|
||||
-moz-user-select: text;
|
||||
-webkit-user-select: text;
|
||||
-ms-user-select: text;
|
||||
user-select: text;
|
||||
}
|
@ -67,14 +67,14 @@
|
||||
<table class="full">
|
||||
<tr>
|
||||
<td id="gui-search-source-label">Start:</td>
|
||||
<td><input id="input-source-name" class="input-box" type="text" value="Karlsruhe" 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" value="" title="Startposition eingeben" 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>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td id="gui-search-target-label">Ende:</td>
|
||||
<td><input id="input-target-name" class="input-box" type="text" value="Aalen" 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" value="" title="Zielposition eingeben" 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>
|
||||
</tr>
|
||||
|
@ -58,6 +58,9 @@ function initLocale() {
|
||||
document.getElementById("input-source-name").title = OSRM.loc("GUI_START_TOOLTIP");
|
||||
document.getElementById("input-target-name").title = OSRM.loc("GUI_END_TOOLTIP");
|
||||
document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE");
|
||||
|
||||
document.getElementById('input-source-name').value = OSRM.DEFAULTS.ONLOAD_SOURCE;
|
||||
document.getElementById('input-target-name').value = OSRM.DEFAULTS.ONLOAD_TARGET;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +119,7 @@ function initMap() {
|
||||
getElementsByClassName(document,'leaflet-control-zoom')[0].style.left="420px";
|
||||
getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px";
|
||||
|
||||
map.setView( new L.LatLng( OSRM.DEFAULTS.START_LATITUDE, OSRM.DEFAULTS.START_LONGITUDE-0.02), OSRM.DEFAULTS.ZOOM_LEVEL);
|
||||
map.setView( new L.LatLng( OSRM.DEFAULTS.ONLOAD_LATITUDE, OSRM.DEFAULTS.ONLOAD_LONGITUDE-0.02), OSRM.DEFAULTS.ZOOM_LEVEL);
|
||||
map.on('zoomend', function(e) { getRoute(OSRM.FULL_DESCRIPTION); });
|
||||
|
||||
// onmousemove test
|
||||
|
Loading…
Reference in New Issue
Block a user