From 99f0abef0cdd1534c94e3fa9e63222fe3e6db8bd Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 27 Apr 2012 17:29:49 +0100 Subject: [PATCH 01/72] changed some mouse cursors --- WebContent/localization/OSRM.Localization.js | 6 +++--- WebContent/main.css | 8 ++++++++ WebContent/routing/OSRM.RoutingDescription.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index dad3ec19e..483007b17 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -49,11 +49,11 @@ init: function() { var textnode = document.createTextNode(OSRM.DEFAULTS.LANGUAGE); var myspan = document.createElement("span"); myspan.className = "styled-select"; - myspan.id = "styled-select" + select.id; + myspan.id = "styled-select-" + select.id; myspan.appendChild(textnode); select.parentNode.insertBefore(myspan, select); myspan.style.width = (select.clientWidth-2)+"px"; - myspan.style.height = (select.clientHeight)+"px"; + myspan.style.height = (select.clientHeight+2)/supported_languages.length+"px"; }, // perform language change @@ -66,7 +66,7 @@ setLanguage: function(language) { select.value = language; for(var i = 0; i < option.length; i++) if(option[i].selected == true) { - document.getElementById("styled-select" + select.id).childNodes[0].nodeValue = option[i].childNodes[0].nodeValue; + document.getElementById("styled-select-" + select.id).childNodes[0].nodeValue = option[i].childNodes[0].nodeValue; break; } } diff --git a/WebContent/main.css b/WebContent/main.css index dde98e404..50465e790 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -515,6 +515,14 @@ html, body { vertical-align:2px; } +input[type=checkbox], +select +{ + cursor:pointer; +} + + +/* table styles */ .full { display:table; diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index e64668748..54ad48a4c 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -41,7 +41,7 @@ showRouteLink: function(response){ if(!response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]) OSRM.RoutingDescription.showRouteLink_TimeOut(); else - document.getElementById('route-link').innerHTML = '['+response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]+']'; + document.getElementById('route-link').innerHTML = '['+response[OSRM.DEFAULTS.SHORTENER_REPLY_PARAMETER]+']'; }, showRouteLink_TimeOut: function(){ document.getElementById('route-link').innerHTML = '['+OSRM.loc("LINK_TO_ROUTE_TIMEOUT")+']'; From 10a96e3aba08424b164ec4aa122c23761cf9ea0f Mon Sep 17 00:00:00 2001 From: shiin Date: Fri, 27 Apr 2012 20:52:53 +0200 Subject: [PATCH 02/72] bugfix --- WebContent/localization/OSRM.Localization.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 483007b17..926c69215 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -53,7 +53,7 @@ init: function() { myspan.appendChild(textnode); select.parentNode.insertBefore(myspan, select); myspan.style.width = (select.clientWidth-2)+"px"; - myspan.style.height = (select.clientHeight+2)/supported_languages.length+"px"; + myspan.style.height = (select.clientHeight)+"px"; }, // perform language change From ab8c700a94b3200cdeacc7b9f7b61961813542b9 Mon Sep 17 00:00:00 2001 From: shiin Date: Fri, 27 Apr 2012 21:09:29 +0200 Subject: [PATCH 03/72] removed localization directory from config file --- WebContent/OSRM.config.js | 1 - WebContent/localization/OSRM.Localization.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 25e63d054..5147edf8f 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -39,7 +39,6 @@ OSRM.DEFAULTS = { SHORTENER_REPLY_PARAMETER: 'ShortURL', LANGUAGE: "en", - LANGUAGE_FILES_DIRECTORY: "localization/", LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ {display_name:"en", encoding:"en"}, diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 926c69215..bab6ee258 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -92,7 +92,7 @@ setLanguage: function(language) { if( supported_languages[i].encoding == language) { var script = document.createElement('script'); script.type = 'text/javascript'; - script.src = OSRM.DEFAULTS.LANGUAGE_FILES_DIRECTORY + "OSRM.Locale."+language+".js"; + script.src = "localization/OSRM.Locale."+language+".js"; document.head.appendChild(script); break; } From 42f38a42db05f548d5381b76bea7fc1a8640bf85 Mon Sep 17 00:00:00 2001 From: shiin Date: Sat, 28 Apr 2012 08:32:52 +0200 Subject: [PATCH 04/72] reconverted all routing arrows --- WebContent/images/continue.png | Bin 414 -> 707 bytes WebContent/images/default.png | Bin 240 -> 221 bytes WebContent/images/head.png | Bin 710 -> 1029 bytes WebContent/images/round-about.png | Bin 716 -> 1920 bytes WebContent/images/sharp-left.png | Bin 530 -> 955 bytes WebContent/images/sharp-right.png | Bin 746 -> 973 bytes WebContent/images/slight-left.png | Bin 635 -> 823 bytes WebContent/images/slight-right.png | Bin 607 -> 834 bytes WebContent/images/target.png | Bin 489 -> 861 bytes WebContent/images/turn-left.png | Bin 676 -> 897 bytes WebContent/images/turn-right.png | Bin 656 -> 937 bytes WebContent/images/u-turn.png | Bin 778 -> 1018 bytes 12 files changed, 0 insertions(+), 0 deletions(-) diff --git a/WebContent/images/continue.png b/WebContent/images/continue.png index 50a54e0b941a21dfd284ce12108f62fef3ec5bd2..7b8c0e5a653d77d81014bd0c90cb3894fb517db5 100644 GIT binary patch delta 673 zcmV;S0$%-|1H%Q785#lr00DNAZiD~;00wkYPE!E?0RI60H&`2ekuey533NqRbVF}# zZDnqB004<9jRpV!0!~RpK~#90?U=i6>Od4l-9nK90Y*qjfW%7}1HuhLG*I#p{1_!I zCHVkaYKqH4O2Y>r9x}or_b67ZNjw9dFh@A|o>fG`lkGJ-#-5C|cQM+R51Pgw(>{^R zJz?w{!m$7Y!phZZwNj~na0U#+fH5Tly&L|4}`5OL7qRNJAY2PzPzKg8=Fv4RsJe9i&0&P^;Cr9iSVA4y6O^Gr1iajRuAe zr9->j=62|GIv6^X4z_JumX-QSHk&=4&loy-R~Zieg${oKt#;u1_nl5PZ!6Kid%2*?B#7X5NJ!3QaiyS zD5|g#%byC&wsEY5DWO_`&xj{xO9LKQrGPQhN2Y6&cK6L>V?|6GMih8$Z( UhiSShpqOCrboFyt=akR{0I9Nv6aWAK diff --git a/WebContent/images/default.png b/WebContent/images/default.png index 7e162eb62f625bd4e5f246c8be66a28aa4ff630c..841e3e8144554ee70a5aafa97cd1a5e10e928a7f 100644 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz#K6E%#MhayL=a3%Wwn;TGj YXR^?al`|%M0y>4k)78&qol`;+08Jk~lmGw# diff --git a/WebContent/images/head.png b/WebContent/images/head.png index 5d1d791a907866c77f58df359387dd94f093f1ee..a691223cf5776c95f632057d21e002146302087a 100644 GIT binary patch delta 1018 zcmVp&cjpdAzi zDe6{#b|~&@7b*0iSg49t8cC9b?X> zj9uj%JUcr>^{1z&%;sRF3Tp`y{0I-nfO~`K>1pz8n3|fhWgxE&1V95@2IxdxU0uq0 zD4LworVJVz8`V@(Qxh`-&E=E4?$Q}pV<`;2zP{8HR5CM&L?UV`8jUhD03011DeDgp z4_S^P8GkTrlF8)S+8PWhWj!+kJvaskZnt}Lb8};3qqVh_y+JyiR@Ot2rNPY1jGBVU z!OYmFt^YiF;x0+?>?(R0cH<8iV z*;&gBZ*OmUJsTSv+uq*3zP^SBk*lk#t*xz*krBPdFE1}O%TOp3u-^E5K5~adQG_;_ z3I?Q|ZrI9zz2043UN$LQSy@pE4PR@L!7KyzFldOrzCP|U3=R%bY5jgbcNqW|7Z)al zmw%U+JdP#d&uh26y*)$K{{B9;Ti_^zjQaZerKP1(sf0Cte}7+GTm)7v;Vy#(I2oJ_ zKQ@EQm{PFRTOePx|8o15?D<-U)hN^>u1Af=m^Ye3)Lbx09m|%Q1ONa432;bRa{vGf z5&!@T5&_cPe*6Fc00d`2O+f$vv5yP;nQz{o=YLy&J=bX%Lx4Qv=CsAJEOqJb#E`uO=x7`?93T!vP1u+C*2vQ6I7=lz*-9@ry zv)PS`eX&^l$mjFlWDUePL6m2mK8M5MeHezH;&7|8pwE84|L6sTa=HAb8^EFLeQOoT zoUm9dt||Od`F|#Xu-R;`($vr8a%8@(K}eFA=%CZ-z%5`8~lYJu681TL&3VHAQ&4C-EKEkSI4?&b4+6RTxxBciJnlYR8H;z z(So*7f2zS(R7QG2qtUQp>lB1)wQ9xIDF`aJJ+w^|M}IgAK~*9^@*jc-b*2wOcUN5yB+Mq4Dd<>ht43-Wml}gZRwG!)L9jt3gMxHT7|KMOS zfO@?SwOS1dg@TL&R;v|^Mk9I7#2w+EOfRK%6t9Pat6~Vi5TqCaFa#-v0FFSQeqP`t z1kO8X$bUQN4wiTU1)k;|w2Si&oOdt>f%6W)c?T`xyaVSQIPaird$LSLj3V$!9V4I( z9FH3PgaEu<=U1-g9WwjZe;$G$c+u!L_G;n1Uor1+p_PJA}@&04dMV@3@J`(to$Q1Z-S1pn-h zIQy)(x7WwVhd%T5_3i2Dv7l$dNAT*^E2RxO`z$|j2>A2BAnVx!Ifs|*(7-VFKuSsq zH1nnvgMuh6J~b%({D1jVlm@LtAt@zo$Q| ztE>4TS;yQf*ucNULHx3F=T7o-a&i(8YR#H8oR5Nnf^u?ls1|maxTPcnQ>Ed2KE838VJ7Vze-8&`6@bIu#I7UZDl^ion00;K(-*1uNz<~oA z7xElfJnV?1>zxDZLaFtVCh4LqE-wD@;|G=b{(t?u^q6dJZZ_eludf%?Y@o5R(Zr68 z8#hAk*s)`@1vy+`U?A5KTDEN20)vRm{rmUPxM|ZSOLOIQ{1qGv1l}aTIWg*jH082N zfC`Z;cG~jr;X^EQacAM2c=F^46hnjetsrC zm~ArR+_`h23_*8yHz#bK5^y<0e}BKKcY?={AG7kD10)2j^pPV+^t}@xTV%C#1YE*z zrFU^yY#qQ8;7q1+@S$}A*5R0BB?0Szqkl(_S|>Pp@}$ZQ27=JgP?e>6kb{!|Yg$P_ zFH3+ECr(%=AcYwLm-{GvfGA|0fb~IaY^;*t-o1OCuc9kgt|$pOQCbe^flNm;EdFD%?Y?*=PrIgjSoj?~VW|&okv+3iQ|@#cWap1ma@S8e0tuO1%m%B7HpUw_&?c@oSckf z8^x7I2J!Ir?b~H#WvG~st0SItPoIQJ%3RG5Bq8cT|rn^|ae7V!@B_+r; zuV24@;lhRD;^OVww+jN=&XPkn_P&7KbhZvm?ErqJ99or#2v6UAlCslmN4+saV_smYjH_ zLx70Km4fcsfD{_Fm}>EuUVqTIg^`gF_IiMGHFt~Uh7Ei6?2&eg5bnwPQ30i_>YT~S z%F-w*Z9plaa>A}%yS#1yL1t#Alo1E()YOzpOKAh#M~X5L*REZg8xv-3-n=Pg3=a?I z{?f!kX~XN+uc0aJ5g~tWOqe-;{=CYDuC6YXmYubfk&!Vc7P#JwNq-r!A~bIubbC5G zJ6qZ#b{TG!V@+J90f(XRH;o)H~8h|ri^~wZ!xPHn^&bX^r zud3qR`t|E^HhIN>-rio-{Sr>thK2^cx}{trI5=2J;BXy4o~$cmL@HN1T(7jwoH=9K ziKUzmaSi#sipk;1JAV!zKCB6U9B`cN*s(*EUl1Vwt*fiE(wn&r7cX863JTJYalop; z;L_64%FD|yU%p&ZQ-jZg2M?kJ?HHN$uE48#p=HU2#>Pffp!g?&_;KjaA)7YD#l@-m zU9@PCDxb9ne}8{XEsFZdrVYS{4P)N_nhRA{ zR&sX&^nZu;ZJ>yEp{=cr`=byG_5eO(Vq$RW!`j^3+@_`` z?tkYTcJJN|+ni3Pcz^DZ4f7cbHp~zF4L1A+qPW9{-2VT(00000NkvXXu0mjf)(@xI delta 700 zcmV;t0z>_P56lIS9De`-m0l76000McNliru+ye~>79DJ@Hh2I4010qNS#tmY3labT z3lag+-G2N4000DMK}|sb0I`n?{9y$E000JbQchC<000000B)uSkpKV!Nl8RORCwC$ znz4<-FcgM;)=7u~5ED>QBDSEULv&2Q1WdpLv^0nccA!HvM}L(G5CfcOxch}A6rJps z=h$)Loc|7NzvnNupP!uwk(88_lvJ0pEIS+yAw9w!oO&~NKA*eYu9R{|&W%;&AGdftX0A)5*m$nmbOX52hzr)c)V;bofUcldvitkB7GC z`Fs}ljpKs|IFrf55r8(riFGW7`~7Yz8V-l<41^KFwH-sll^B{K7DKPsGZkI0SNBd3 zMhMq${ePR-N<0tvcHiSn0GvUvP#bcMHspMw1-Z9q#~Dbp;4CVddMEH{#c(_x3+r4i zm+^Rvc`}>Lrqk*B|NVZy-EL9j%TXCce@7PmU1jul#?jy1*AC!{vDs`m*2BEZLT9W2 z8u(7pIxC}-JQ>BiUD1Mf>;y(k-#Tb9;``=A2{nmYFaV{+Vj(?#`=f+a822|=Nl8gb iNuKrdl3#;pi9iD(TI^3~%Mb@$ z6x>u0T%5$owQK4R2x_RMqDctE*(Dm9ngb{M;e*HH<8$YE_Z*(_dFKG4>B_*UCYQ^hU3qeHB3JYN{tll{Pfw_~&1Qp7JT;}pG^N|^ zjwgSn#WneS{%VTS8iJ#vBdCeRVoTJ>vvkec6u|B$76rKiafd2@DllP47Cb*c&-a!q zsMTsjzal z-fSGDQVE|s?vOg4EO6B8btoQG2j`D0nb3A z)oKyKg@MwwizBC9*9Q-1gTVtp-zNN2Dlw?I2__!@mB{pi9~{ljzDXM z!C-*TUOq#AG#X_xX#({b-rnBe5U0*nD#KEb-Ib#zgCGdOU{L0`-`w0>afU{t0lsiJ zjDD3N^7ZvqtyVoAkId|0{YfU1_$!aqWWe8GdA;6#zYiN>_QXRV0yuus=`TKW;Nauq!?+pH+jS*GA`$BIjn!v( zd3hn8q08fRI&W@njFmw5>6%E#LytH;dctetmt_L&u+M7=!j-R delta 515 zcmdnZK8a<5WIY=L14G~UldeFDCEd~2k%3`jKlh(RRv@3Vz$3Dlfq`2Hgc&d0t@{HM zWH0gbb!ET9%*AhL)bjYRKLZ2fLQfaRkcwMx?`+I%b`W7pkm_bsV(VDpGug=J0F$Qk zWKN^TqbwnsE1izBtPE=FJ5}OyfF;E7<7B-_tqejXQ z-}_evuUC4!qPJOjCnF<=0|S#l0|Sc!1B7YTb)od`I*qR7DxQ3Ymt_9BWpZ}!RSuR1 zm2uU#{#57@wafz+{y4fU8tI6GLOD$AxCm@r$)=l zNLLo7Uh!R-SF2c$rQHHC|Kj?N?n|s^()t1a-^E5X(|LA6e20@c#(^TzHXo$>O7Pcl!Ff9J+FZt}* z`gd!svdwiqumJQETQ`3MB! zLP$t}LPbb$042IGvH5qXA?(b~4o*fO0SN;nZn7|#@K?a9O@A;dkuVrLxIhdF_YEiZ zp4%@zdd{U_e-r83r%#`raz5IcCd!!RtyQa4#hPh~V$I|62z!WYxLT&Bc+90TEM6Fo z$1(+<&u2E9zrVj_3b|YkPA`>8$rLUwF2qSuLB@k&m|Cr-A%_a&G@(#P)cCVC5E%q6 zmkTL5j)RRX%YV++peuEBbY%KrUd{0j*=$x#27_;1Nx2Q8~wSQW$TRxu``VXxhXk$1WHpxNK z10f9gR6Nel&t-EwK0Xr8p^nZx@c+m4^)(fb7mWE;i+L;!bq~Y9FxV`E>J*sVpPikN zH{f|5@1N~_{i!0+36YAkqx55Uo@y#O)@O*3+3x#w#Hd k3eoVI7|%8I!X{++1N3RAS(enV)Bpeg07*qoM6N<$f}t0-_5c6? delta 733 zcmV<30wVp*2kHfo8Gi-<0055n$wdGF00(qQO+^RX0}2l@DwmIC82|tP32;bRa{vGf z5&!@T5&_cPe*6Fc00d`2O+f$vv5yP0Az+Z;fap$QLVs8Y8j1HVG!oMamEQF( zynk|O$i3cOfBpA*uce{cY?cCmD^_k{LlvHHhlXK12R)deWCT3`6+{q#AaD@`AP8Ip z0SE#YK>&ilMG$}>a1jI`2wdUyoA9Q|WU|%iboN`V)}d2h<~w+kE|1ihspoStbMNmqV}DvzEnFDwWG}xqKmQP_mt1S=JLQae`e6g~FYTF)2MU z)@rqa3=m2~kOe|{2r@uu0YNkfZ6JsQp%nyCAhd%Z0)&kU%^FMzu(_+ z3{Y{!7>PtC%VJ=~l_dg5Bocj$>vp>-rx+!jFdB_aHh=KfRpZ?pfdE)W+8Yc8yZC!N z9-EF0sOSXy0PHikYC#aVpWFVWQpxc+m2?6s8jXH3`&wQdfoC3VzvzHvlKxP|D+qQ* zEiVUzaV);;r5|OTum}Pjk;~;CMD?LO1RF%N**s>~d~IVP*kafGxd;$iK@bH(I|w!i zKj#Q7A%CE%)#{mFZ7F?=bklq#*!HVE?VRv?DZFtI)&-EwW*@bN;D-ZD(;RCJA(P3p z*8#xN^ADDXyg1cqGch(Ajic#wy8Yk%@g*-?c{Vi|K~#90?V3G{>Od5RqZS6i zFH{h06zu#$Fj`oMg1Bg5BNifpl?b+WR)Uovw*C_fe}Z6PEq`n!2v+_8y>mBLZ;Y8Z zlbs`e%u_6y*^}qINyf>>6;61B`(wfndSjEx1iMdFDfpOnpY#LR$jxRG>-YJ5!C+8h zAR3JZ0s-xTNF<^$AW2dxl_GAJimRGRrSf%#v_?47>-9)$WHOnITv@BtNNY|%hY8hK ztybz9<DFMj@&bqg9pDQL@ZOGeIxXCQCfRorTqBaYQ8JAdNw_{9;6#Xua}?e_Z&dJW<* z47h^}K2|UukH2m}ALi@znvFnny+Z=py;BI1$)th3lM2vnhq1kr3J_ke7gm69yWNZh z;c(byvnd_uEi*x}Sd?Eo91f*}YKg`Q{C>akt<&i=oP%^GtBw_W!Rh+Ua{(7{0T;Zj z;9CKRz<(HA@C@(_&jHWy9DG=YdcAHon*}n^pLnHGX}Mg&wSIvj1Mcau3Y0US&%HI=An?=`;PLgOe`s;=@V82ec+im6lCn%x%3Wpq!dyQBurkTOOGe;6YGAO@3 zQ_Ttp-9t0bK9?ngXTX5V@Je%z`!$5^U!trl`%y{W; z-5;PJOS+@4BLl<6e(pbstPBiHT%InDAr-gY-ZJz*nA*)45y_lc8rqYk zCmV4@FW!BhLHKaT`~$Ivg3KR1Q!h}QabwCtM`5@6!lKMY8$Z5dRi1o7`&;b8zmvV$ zql(^7-~DXe&JY2XYK8*6Tc&F=jV`~=wwfy!RNkhQ`HJs_fE$C`0RtujrZ&L_L4zKK zo`#bv>|RvfE8Bc?Pf_gkfWQ4^yK4hiUwyYi(BYk|%Wj_EF?-{-AARb*HFa}jyi?G1 z{lzx2i+UIsKh!_8=nK@E8n=Q`NpTGq17}kn!$zeOf)`$v_?0quh$_xMzu#P{H~LkR zr=Z&8lW9wXDi`R@5OGX1kdTR(R_YvUqS@rL{r1+9W`#(z{|-O)?RVsD2#ht9YWv6{ z7}m2%wAyK>n84?{D9NjtX!i)>MF1-HQC-zrPKD3@xD+=3((=yPuF&ppENAJxP)UDJd_ey5?FYY8I%(w z7$q1Fa~$B1NJ9(BSxP59`)2nCtPOjAT~6^GD2&~HuGpXDb6Li!FZtZ=^reCtU30|e z@d5R^HQX;hlqkS*rB>0~OGKaF^KDRhi_!gAQCipfr_J#JrW6KGS3j3^P6m^Pi z5n**vukn)5#8&tM$I`;m2k=>J2w~+V5lacNv&72ELc&UHDu1!GK@dHY)10Qarqwca z>z;WQ68@g~&C_W!GaZ5v7ong=d<#-@yWOHS?$;O9gnfRlFc=I(W99RCVd3NBqfjV7 znzCB0#bOasa5x<%ph6nVU z8Jo?9fT`c_BV(`%1OfsE|A~H<;rIKYInXd-v6!IU`Fsw3KOT>080^f$X*e9pG%8>i z3{XW18gfnPEIDD<8e6|z}89ZeK1t7zLz?k4%jWdafaD!mPjOSxApIl;c~g8QYoEI_m=n4 z`Fu_$lXAMQ#SGW$l_W{&?%Hg&cDv1dzaZgGeSb8OVY}Um9ddDsMx)(sS6~EBJVj9; zgV>oKROmB+eUj7Zl<0jV5&?ZhNK_?*;HZuhnCTXa1#%+#4Abe9e-y}9sZ>IaW7Nnn z8jZwe07XY>@`W?N1Tq+n#`n%3@l4|kqQV(q!WkYB&H$4{hH|-#9LK1UVZB~Mm)u|h zQZK93kmDGY*50{X?$3=p9*-I<2ESj@ivEWTUoFXhFRAt10ssI207*qoM6N<$f_tEQ APyhe` literal 607 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz1|<8wpL7LM>?NMQuIzW1x%drbB1}It0EIXU zJR*x37`TN%nDNrxx<5ccmUKs7pyrMJ+mzi`{bf{F=QEh-9Z z&5o8|ITodDu9O#Dc>8Uf>&|6m`fkSy^_)1=Pi>s{JaVQ(2lqrtmcYdqE2fm{=KfO> z7ta5gwe^?6>#AF}oW%{-Z{}>jK^;F9uzKMGRBCmVQ5@;KKOgYt{3` z7f<+=$SuserNiKJ`AcSVW+6wxwu-)|n%`>PPUK^`Ug~eQvvT9t-+veXKev@*;w;t> zk%p)038F4p0$E#c6;EQ=-zmD}{cr1)4l6>m^gWr6_=U4%GVD_FV7(yfsKtCsQ_U&)T0kD}GyUy7a;b9lyi#SH5|@ zj{7|e6B9ejuWEG}cE<%(I;T#xn(OcTY#CxJF!e8kd_lH6E5m~|z?8t?>FVdQ&MBb@ E0HUe&y#N3J diff --git a/WebContent/images/target.png b/WebContent/images/target.png index 3bcb3b732d07b6e99803c7fb9722ffd8130c65ef..0a695969f1063ef296a5acc68d5d2073aba66c3f 100644 GIT binary patch delta 829 zcmV-D1H%021KkFY85#lr00DNAZiD~;00wkYPE!E?0RI60H&`2ekuey533NqRbVF}# zZDnqB004<9jRpV!0_aIZK~#90?V8VvIdK@rv8+XwX#KX@l|Mi^C0H62w_ind;OCEcBdlP(xaZDr+vr3;$?v=JPq*TBFg3 zMqua0Q!bZ7S38@3&Gy$FkH;R52PUgjDjI>St1GHg>CMfJ-EI$sLYYh^olXY=0f)n( zR;%%I=mj(y&7RXWE%X99oel{g0VIGEfJ2w90JK#s1gh04j8rNWv)O!kc}Z1NDwV>7 zX0u5w%}4-GyWK7n3h{V6kx1n8`PbK1s-g!990n3V0!UzgM__uV++js!Oz4(R83 z=i!?-K*$4s@_;-b56Hv+)sU*~`k7>Di%rrqD)L$mbw`1tbj!hFR?^ze%y5Bvam z;0MS9KR_P%0i}n2zi+i#4Ftd#>C2G6$XP!lJ0Xx52Y&DupTyq+pgjPp00000NkvXX Hu0mjf1wn^& literal 489 zcmeAS@N?(olHy`uVBq!ia0vp^jv&mz1|<8wpL7LMEa{HEK*5du+g3=Lga}yiO=VEzW4Nx*tX;QyTd1s z+H$U5_xi7;-R#v96HVp$rk!MF5pZB&Y_S$xwd&TY)JTuM2hm$_tp?oyE=w_9zOdHVt<^M* zO8ucy!IcW)-fRjYLXm7oW(ty!jvutVPj}Wa91VMdsG)IWihv#|i3ma&3J43KWd5QfBuCA_3 z2)te|$8opy+7ci~%G=wUvPye8s$h&(<%Vt;ywliG?0KGcIOkBf^7$>aU~ z-4TyZ8S2)fue;RX@CM~_x!3DCWdOT1m_AM!6pKZ1emY`scXuZhfSa3}R;%^&^n~-? z?sPiS=@em*$z;sFr4=L+30;F~wYuZgfmkeNlmJ#uI~rVGULu}BFc_5n8CYT2Oe&4hK081`s4e+4`)PNf7*#KQlEdYB^ z$v}OwWrM+BFpvxoFC5DlEVGYzWk(J6X0Qin1~Rai;r90S>+8$ju2{x&hC-phFbv0W zwrsR)!9<2qsU#f|{=5v8N=0#!dVYTXV>0kOkAM8q3OG4AVQhkB*+3u=3WZ=j6pzQ3 z%cb=Uxm*sX_f7*b7K??I47FMfM*N}s{|8t+etdjbd=9|<{XOjd51Rp&@aofM6B(pu zB0s+tIXyjXHk-rYa59;E?f}SNUthc3ZaSTIFoQ@wpO+ud*j`%&L4f<>YzC2Hu^0}A zoo>hgJ2a@*`^W%%e}6;CN~Kb^XHbt=r!qJM%|He;0~yc^WI!{J!I5Nut&ciGG#dRe z8D3sqVDF~R0Q-m0Xk@Ge1X0utOkf02fp&7`4W*~##!A=vk5sY*o00000 LNkvXXu0mjfJvf(u delta 663 zcmZo1It=x;a{Zrg$aaY)$~ioDaqZb%sm^r)_2K<;{8eyUK!iKHKZE@{Q(Kk*lZi^FNa|onZ&3(7F zXM=8J$A!G@`Zp>*wB7XxX^GMMes-CSb9l$WgoHIc3#?n7SJnq{1a+(O9Zcg=&RMqN z`fI<?m-kRN7ucpKqo^l9TeKq}CrOf`Q`Lmb(yz>6Lujo`= zQ|p{dYY$F4#lPxRR8`j<6%LaY6(^TCokZskbCsOSLRi zT+#DIM3U_wpQ_lKe=c0P^$QvVTsRmx99sl%GE^>dv?W$V_Xp@r=X5k{VQ5is;#gqF zR38_3)YQi7U-OdHVD*~eO z6GRWyu!04!URtT z8T-e~w6r)J`|RZF+jrjne4T0KJ{QAje|md+Q`9&m>e~0NFg3NG*&1yIat&MHG<+B2 z+uq#V=ob{bGFUJ^T%%BFRO3^eXFSbjQ(vR&lg(yvK2$?pxrQFY8XE*W&l?l$?(TX# z9<^XLo8eFV)_>NPLNFSQh!=}OAd2FmvjIbr|E>`1?Cj_YbV6eUD%cfBht+`K<>dtg zdwYAd0(uw}m|%T8;Hvg|y#_qy^SK}hf9ZhEeS3Smxw$Fbg>JW-?D72kOuWg7pw6N1 zf%<|3^d`8N|12gP4*PsQx#ar#nvg^8A#Z+oq_&jFWPfz4I1ifpSK{jG3RAVl1CQfj z-eWu-BadJ(Xp0B%D8nuf%lR)n9D`LD^m@J1(^Gp5;0{fv)Akww#bS}l;OXh9-EPx7 zw_B}NqtQ4yIYFJ~;^Kl}5Rb==KBZNpQYoCl(b3V82Ef_b*+K(&&@Z`n)l^Dt5Q#+O zTZclSgMWjAMRN`)`Tc&E%Z0XwKMChRZcwdOKPf<0(f0PXwu&?8cDwWjFoV*qT4R8D z)>>eI$1!jW90RQZ^e=l2c%DZF&;zVDI6OQ=2K|2DdV}?wV><@Fz+eS98Q6f846m=R zg+jrcmX!?f43fTcl*?tKTDCGsk33k+L}JUl!+E&<4g!{OcC9r}udfMb7od5IsP z`F{*9mka&lfhEX$EBEj1PrY8J)SAoy-N}-r7XoE~V_&P)3~5bf04K{cK=Y_nD(~;_ zMzySDSOzBp8#o!*z{$V{zaxY0oNt{nj7FnqG^)+u_xsl-!(=j%zuZN@nobae)eMmc zc`XV{LG5?LL?W?*!BN7>JAq|zGO&S@ffo(F03kva=;bIB>;M1&07*qoM6N<$f~6R> AvH$=8 delta 642 zcmZ3I;fI^%F9+AZi4BSE>%y{W; z-5;PJOS+@4BLl<6e(pbstPBiH@}4e^Ar-gY-rnzj$U%htgL|{%G`~;m8b%p;(~lnM z<&2bhDqoP2Tu@r_MgBmquh`>5D)o+wotw{{y2e_6@j}IWrj3T0GIypvzV+Q#s_se9 zJ3Gzt{%ubV8Q3s2Xz#o0=r(!2ZJkx$=d4}E%O1^mcfhPgph3WegHgxrLv8*37`@+* zKUS!3=9qjkrQAYB&fr*Fh~gU88Sd;YUpcH4f*KcaO_X90<;WInQYa{Oe3B~d)_hv{ z+_}%!@8*41sz1qiJ!`A__0r}S)xBZETo~MvW1Ss5WWBf6f~5^P8$e?mIjSpeSc~s3e6cJ#1CL-RYFI? zJ-Lm0%kJ#FEQ`FjzYb=e`OklLX7-r@T~8hzxlGrOxa@y*^~xfV2)azE2lfJ~YuT== zU!aB$41F;=EVvj%!y}D(dU_IeJr;}6>XggnOeQ1M5z7*5s1Wm&0nKKU?b#QLMNB}Y zQb7mI&(DkdfPW8ISy>SUEG{liOh7)Lhl07eIZ=SYU_b=OjXF*NSsQRT9Ps7y^RqYr zn3r@(|jlpO%E-fwnKw+_1xOE`i zHW)OPmzU+nlLr>yKpN5&FNIs7-&5n{A!XPja~&Qe$>@ zmdyup)~~OxQ~G##cpz(tlr}dvF|Bhn8jaIW5KR%|2S?M;1SVhL<>lq}_Llz53YA}9 zUugx_*4B{w2a(;~T`B?LR>OqL<)RXRq)?dv?7>O|%w{t(D*)h-Agn2UYmo&mE-sLD zc(U2-Kz{=F_xE^#^YioJ3cyiS6VL=kAfOX4bb*_j8@#~&{yvpJBog71Mxg*~INXf=iAoKwvgKwQfNfx}ly$xr-$A8C18UYMboEK>V(37gIKQ$3(HyWQ?|IzhtY@!)T-lz4!170AftI70$bmR75! znulVsD7+l}8sM1_(-1ZfiVy6Hf$1u}NgaxZP$+bEc6NPz{fnKetE=PV&+Fc?K?{Z6MdN)O#`Hy8{edrSjl4T(g8-av1t zbBXo0F@wPnkH?vMkN4nqyVY3_dwY8{V`#s%wWXlh*e~09a{0$M@1c06NUF0;cz&WN~zlw#eBcJnejyP dFdj^Uhrd)gXc9YT0|)>B002ovPDHLkV1gSc#$o^f delta 765 zcmVg-56aYbT=RhkOUwJ z9FhPefkP62Byi5dhX9z*=a-Ac;)%CEolZ^Lw#`Fyz%)&}P$<~memb4L&15pad?MfiDpHcAZLn$Tr)60mYqi>E znQ^<_?wd}hV@aExg60X6$pn|>cFxuHdc7^P^Y^J%tAC&Noxj;^3iV6r?T|{PeyfVj zQss%PSSLLuh(Z$Jh$WQE?O#ABmha^kOUwJ9FhPefkP62BydOqkOWR( z3Cra&rMvOkB@BndSGpUoUBW3r5`ZLdb}qT&ADV-~pz?4K#08ChzkjnY_;@_NZnxWS zHyvN8RDTBfeEx@S0i0b+?kZ~!?qUZBO3BcH@CEPFL2`oXjh(ikSgV5|CLqt>s2ulbnBFX}MNeC(;>H>UA@GC;40K+i; z?E4JXG>XIuRG)yIa$VOf7K^syIL{6(0Kr6yC3bVUZN*tANw}ypOfe_cGHyz!@HKo- zMdy_eM#3f$M<)Ozls^!w!HtBy5>5g7DGelnLlS@_a7Y4>1P)06 vlECpY#+NK%(%lwqoUzVho}bg*5S{!746~hr32D@000000NkvXXu0mjfe3D$+ From 90925bd91d721b22fb319978c38486d045f50c9b Mon Sep 17 00:00:00 2001 From: shiin Date: Sat, 28 Apr 2012 08:33:55 +0200 Subject: [PATCH 05/72] made printing window more robust (on refresh, stand-alone opening, closing browser window...) --- WebContent/localization/OSRM.Locale.de.js | 1 + WebContent/localization/OSRM.Locale.en.js | 1 + WebContent/localization/OSRM.Locale.fi.js | 1 + WebContent/localization/OSRM.Locale.fr.js | 1 + WebContent/printing/OSRM.Printing.js | 33 +++++++++++++++-------- WebContent/printing/printing.css | 13 +++++++++ WebContent/printing/printing.html | 8 +++--- WebContent/printing/printing.js | 23 ++++++++-------- WebContent/utils/OSRM.browsers.js | 11 ++++++++ 9 files changed, 66 insertions(+), 26 deletions(-) diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js index 86c555fb6..b1dde0154 100644 --- a/WebContent/localization/OSRM.Locale.de.js +++ b/WebContent/localization/OSRM.Locale.de.js @@ -52,6 +52,7 @@ OSRM.Localization["de"] = { "NO_ROUTE_FOUND": "Keine Route hierher möglich", // printing "OVERVIEW_MAP": "Übersichtskarte", +"NO_ROUTE_SELECTED": "Keine Route ausgewählt", // directions "N": "Norden", "E": "Ost", diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js index 1210ce2e7..8f20a94ef 100644 --- a/WebContent/localization/OSRM.Locale.en.js +++ b/WebContent/localization/OSRM.Locale.en.js @@ -52,6 +52,7 @@ OSRM.Localization["en"] = { "NO_ROUTE_FOUND": "No route possible", //printing "OVERVIEW_MAP": "Overview Map", +"NO_ROUTE_SELECTED": "No route selected", // directions "N": "north", "E": "east", diff --git a/WebContent/localization/OSRM.Locale.fi.js b/WebContent/localization/OSRM.Locale.fi.js index a650fadab..ab63bc61f 100644 --- a/WebContent/localization/OSRM.Locale.fi.js +++ b/WebContent/localization/OSRM.Locale.fi.js @@ -52,6 +52,7 @@ OSRM.Localization["fi"] = { "NO_ROUTE_FOUND": "Reittiä ei löytynyt", //printing "OVERVIEW_MAP": "Yleiskuvakartta", +"NO_ROUTE_SELECTED": "Ei reitti valittu", // directions "N": "pohjoiseen", "E": "itään", diff --git a/WebContent/localization/OSRM.Locale.fr.js b/WebContent/localization/OSRM.Locale.fr.js index 3629455a2..783ecefac 100644 --- a/WebContent/localization/OSRM.Locale.fr.js +++ b/WebContent/localization/OSRM.Locale.fr.js @@ -52,6 +52,7 @@ OSRM.Localization["fr"] = { "NO_ROUTE_FOUND": "Pas d’itinéraire possible", //printing "OVERVIEW_MAP": "Overview Map", +"NO_ROUTE_SELECTED": "Pas d’itinéraire choisi", // directions "N": "nord", "E": "est", diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index b87861a53..383726589 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -35,6 +35,12 @@ init: function() { input_mask_header.appendChild(icon,input_mask_header.lastChild); document.getElementById("gui-printer-inactive").onclick = OSRM.Printing.openPrintWindow; + + OSRM.Browser.onUnloadHandler( OSRM.Printing.uninit ); +}, +uninit: function() { + if(OSRM.G.printwindow) + OSRM.G.printwindow.close(); }, @@ -128,14 +134,14 @@ show: function(response) { // draw map var positions = OSRM.G.route.getPositions(); var tile_server_id = OSRM.G.map.getActiveLayerId(); - var zoom = print_window.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) ); + var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) ); // draw markers - print_window.prefetchIcons( OSRM.G.images ); - print_window.drawMarkers( OSRM.G.markers.route ); + print_window.OSRM.prefetchIcons( OSRM.G.images ); + print_window.OSRM.drawMarkers( OSRM.G.markers.route ); // draw route & query for better geometry - print_window.drawRoute( positions ); + print_window.OSRM.drawRoute( positions ); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&z='+zoom+'&instructions=false', OSRM.Printing.drawRoute, OSRM.Printing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'print'); }, timeoutRoute: function() {}, @@ -143,13 +149,13 @@ drawRoute: function(response) { if(!response) return; var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5); - OSRM.G.printwindow.drawRoute( positions ); + OSRM.G.printwindow.OSRM.drawRoute( positions ); }, // opens the print window and closes old instances openPrintWindow: function() { - // do not open window if there is no route to draw + // do not open window if there is no route to draw (should never trigger!) if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) return; @@ -167,16 +173,21 @@ printWindowLoaded: function(){ var print_window = OSRM.G.printwindow; var print_document = print_window.document; - // add events - print_document.getElementById('gui-printer').onclick = print_window.printWindow; - // localization print_document.getElementById('description-label').innerHTML = OSRM.loc( "ROUTE_DESCRIPTION" ); - print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" ); - + print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" ); + if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) { // error message if no route available (can trigger if user refreshes print-window) + print_document.getElementById("description").innerHTML = OSRM.loc("NO_ROUTE_SELECTED"); + return; + } + // add routing content OSRM.Printing.show( OSRM.G.response ); + // add events + print_document.getElementById("gui-printer-inactive").id = "gui-printer"; + print_document.getElementById('gui-printer').onclick = print_window.printWindow; + // finally, focus on printwindow print_window.focus(); } diff --git a/WebContent/printing/printing.css b/WebContent/printing/printing.css index c09d75ea1..9002c7c17 100644 --- a/WebContent/printing/printing.css +++ b/WebContent/printing/printing.css @@ -135,6 +135,14 @@ div.label min-width:10px; min-height:10px; } +.not-selectable +{ + cursor:default; + -moz-user-select: -moz-none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} @media print { .pagebreak { @@ -217,6 +225,11 @@ div.label { background-image:url("../images/printer_active.png"); } +#gui-printer-inactive +{ + cursor:default; + background-image:url("../images/printer_inactive.png"); +} /* table */ diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 4e53a0cc3..0d4b0966a 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -45,22 +45,22 @@ or see http://www.gnu.org/licenses/agpl.txt. - +
-
+
-
Route Description
+
-
Overview Map
+
diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index 2cd947367..a8c272001 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -32,7 +32,7 @@ function printWindow() { //prefetch icons OSRM.GLOBALS.icons = {}; -prefetchIcons = function(images_list) { +OSRM.prefetchIcons = function(images_list) { var icon_list = [ {id:'marker-source', image_id:'marker-source'}, {id:'marker-target', image_id:'marker-target'}, {id:'marker-via', image_id:'marker-via'}, @@ -51,7 +51,7 @@ prefetchIcons = function(images_list) { // function to initialize a map in the new window -function drawMap(tile_server, bounds) { +OSRM.drawMap = function(tile_server, bounds) { // setup map var tile_layer = new L.TileLayer(tile_server.url, tile_server.options); OSRM.G.map = new OSRM.MapView("overview-map", { @@ -70,29 +70,30 @@ function drawMap(tile_server, bounds) { OSRM.G.map.fitBoundsUI(bounds); return OSRM.G.map.getBoundsZoom(bounds); -} +}; // manage makers -function drawMarkers( markers ) { +OSRM.drawMarkers = function( markers ) { OSRM.G.map.addLayer( new L.MouseMarker( markers[0].getPosition(), {draggable:false,clickable:false,icon:OSRM.G.icons['marker-source']} ) ); for(var i=1, size=markers.length-1; i Date: Sat, 28 Apr 2012 08:54:53 +0200 Subject: [PATCH 06/72] =?UTF-8?q?=C3=9Cbersetzung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/localization/OSRM.Locale.fr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/localization/OSRM.Locale.fr.js b/WebContent/localization/OSRM.Locale.fr.js index 783ecefac..ff4d04bea 100644 --- a/WebContent/localization/OSRM.Locale.fr.js +++ b/WebContent/localization/OSRM.Locale.fr.js @@ -51,7 +51,7 @@ OSRM.Localization["fr"] = { "YOUR_ROUTE_IS_BEING_COMPUTED": "Votre itinéraire est en cours de calcul", "NO_ROUTE_FOUND": "Pas d’itinéraire possible", //printing -"OVERVIEW_MAP": "Overview Map", +"OVERVIEW_MAP": "Carte", "NO_ROUTE_SELECTED": "Pas d’itinéraire choisi", // directions "N": "nord", From 23d1ea2a32719dddb8245ea7465f97ff3bc75380 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 3 May 2012 09:06:34 +0100 Subject: [PATCH 07/72] polnish tranlation added --- WebContent/OSRM.config.js | 3 +- WebContent/localization/OSRM.Locale.pl.js | 93 +++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 WebContent/localization/OSRM.Locale.pl.js diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5147edf8f..730aa4115 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -44,7 +44,8 @@ OSRM.DEFAULTS = { {display_name:"en", encoding:"en"}, {display_name:"de", encoding:"de"}, {display_name:"fi", encoding:"fi"}, - {display_name:"fr", encoding:"fr"} + {display_name:"fr", encoding:"fr"}, + {display_name:"pl", encoding:"pl"} ], TILE_SERVERS: [ diff --git a/WebContent/localization/OSRM.Locale.pl.js b/WebContent/localization/OSRM.Locale.pl.js new file mode 100644 index 000000000..0cb435122 --- /dev/null +++ b/WebContent/localization/OSRM.Locale.pl.js @@ -0,0 +1,93 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [Polish language support] + + +OSRM.Localization["pl"] = { +//gui +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", +"GUI_START": "PoczÄ…tek", +"GUI_END": "Koniec", +"GUI_RESET": "  Reset  ", +"GUI_SEARCH": "  Pokaż  ", +"GUI_REVERSE": "Odwróć", +"GUI_OPTIONS": "NarzÄ™dzia", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy", +"GUI_START_TOOLTIP": "Wprowadź poczÄ…tek", +"GUI_END_TOOLTIP": "Wprowadź koniec", +"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting: KIT - Geocoder: OSM", +// geocoder +"SEARCH_RESULTS": "Wyniki wyszukiwania", +"FOUND_X_RESULTS": "znaleziono %i wyników", +"TIMED_OUT": "UpÅ‚ynÄ…Å‚ czas oczekiwania", +"NO_RESULTS_FOUND": "Brak wyników", +"NO_RESULTS_FOUND_SOURCE": "Brak wyników dla poczÄ…tku trasy", +"NO_RESULTS_FOUND_TARGET": "Brak wyników dla koÅ„ca trasy", +//routing +"ROUTE_DESCRIPTION": "Opis trasy", +"GET_LINK_TO_ROUTE": "Generuj link", +"GENERATE_LINK_TO_ROUTE": "oczekiwanie na link", +"LINK_TO_ROUTE_TIMEOUT": "niedostÄ™pny", +"GPX_FILE": "Plik GPX", +"DISTANCE": "Dystans", +"DURATION": "Czas", +"YOUR_ROUTE_IS_BEING_COMPUTED": "Twoja trasa zostaÅ‚a wyznaczona", +"NO_ROUTE_FOUND": "Nie można wyznaczyć trasy", +//printing +"OVERVIEW_MAP": "Mapa poglÄ…dowa", +// directions +"N": "północ", +"E": "wschód", +"S": "poÅ‚udnie", +"W": "zachód", +"NE": "północny wschód", +"SE": "poÅ‚udniowy wschód", +"SW": "poÅ‚udniowy zachód", +"NW": "poÅ‚nocny zachód", +// driving directions +// %s: road name +// %d: direction +// [*]: will only be printed when there actually is a road name +"DIRECTION_0":"Nieznana instrukcja[ na %s]", +"DIRECTION_1":"Podążaj[ drogÄ… %s]", +"DIRECTION_2":"Skręć lekko w prawo[ na drogÄ™ %s]", +"DIRECTION_3":"Skręć w prawo[ na drogÄ™ %s]", +"DIRECTION_4":"Skręć ostro w prawo[ na drogÄ™ %s]", +"DIRECTION_5":"Zawróć[ na drogÄ™ %s]", +"DIRECTION_6":"Skręć lekko w lewo[ na drogÄ™ %s]", +"DIRECTION_7":"Skręć w lewo[ na drogÄ™ %s]", +"DIRECTION_8":"Skręć ostro w lewo[ na drogÄ™ %s]", +"DIRECTION_10":"Podążaj %d[ drogÄ… %s]", +"DIRECTION_11-1":"Wjedź na rondo, zjedź pierwszym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-2":"Wjedź na rondo, zjedź drugim zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-3":"Wjedź na rondo, zjedź trzecim zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-4":"Wjedź na rondo, zjedź czwartym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-5":"Wjedź na rondo, zjedź piÄ…tym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-6":"Wjedź na rondo, zjedź szóstym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-7":"Wjedź na rondo, zjedź siódmym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-8":"Wjedź na rondo, zjedź ósmym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-9":"Wjedź na rondo, zjedź dziewiÄ…tym zjazdem[ na drogÄ™ %s]", +"DIRECTION_11-x":"Wjedź na rondo, zjedź wybranym przez siebie zjazdem [ na drogÄ™ %s]", +"DIRECTION_15":"Cel zostaÅ‚ osiÄ…gniÄ™ty" +}; + +//set GUI language on load +if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true ) + OSRM.Localization.setLanguage("pl"); From ec5934364a4c89dbc32975a35a228ec292e33438 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 3 May 2012 14:18:11 +0100 Subject: [PATCH 08/72] images moved from css style to main.js --- WebContent/main.css | 54 ---------------------------- WebContent/main.html | 1 + WebContent/main.js | 34 ++++++++++++++++-- WebContent/printing/OSRM.Printing.js | 12 +++++++ WebContent/printing/printing.css | 13 ------- WebContent/utils/OSRM.CSS.js | 40 +++++++++++++++++++++ 6 files changed, 85 insertions(+), 69 deletions(-) create mode 100644 WebContent/utils/OSRM.CSS.js diff --git a/WebContent/main.css b/WebContent/main.css index 50465e790..62905c5a5 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -113,7 +113,6 @@ html, body { height:50px; background-repeat:no-repeat; background-position:center; - background-image:url("images/osrm-logo.png"); } #input-mask { @@ -139,7 +138,6 @@ html, body { .styled-select { position:absolute; - background: url("images/selector.png"); background-repeat:no-repeat; background-position: top right; padding: 1px 1px 1px 1px; @@ -404,61 +402,9 @@ html, body { background-position:center; } -#gui-toggle-out -{ - background-image:url("images/cancel.png"); -} -#gui-toggle-out:hover -{ - background-image:url("images/cancel_hover.png"); -} -#gui-toggle-out:active -{ - background-image:url("images/cancel_active.png"); -} - -#gui-toggle-in -{ - background-image:url("images/restore.png"); -} -#gui-toggle-in:hover -{ - background-image:url("images/restore_hover.png"); -} -#gui-toggle-in:active -{ - background-image:url("images/restore_active.png"); -} - -#gui-printer -{ - background-image:url("images/printer.png"); -} #gui-printer-inactive { cursor:default; - background-image:url("images/printer_inactive.png"); -} -#gui-printer:hover -{ - background-image:url("images/printer_hover.png"); -} -#gui-printer:active -{ - background-image:url("images/printer_active.png"); -} - -.delete-marker -{ - background-image:url("images/cancel.png"); -} -.delete-marker:hover -{ - background-image:url("images/cancel_hover.png"); -} -.delete-marker:active -{ - background-image:url("images/cancel_active.png"); } diff --git a/WebContent/main.html b/WebContent/main.html index 8d6c75edc..5be9ea0fc 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -67,6 +67,7 @@ or see http://www.gnu.org/licenses/agpl.txt. + diff --git a/WebContent/main.js b/WebContent/main.js index 313c5a39e..ee9319635 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -23,6 +23,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.init = function() { OSRM.prefetchImages(); OSRM.prefetchIcons(); + OSRM.prefetchCSSIcons(); OSRM.Localization.init(); OSRM.GUI.init(); @@ -73,7 +74,9 @@ OSRM.prefetchImages = function() { {id:'direction_8', url:'images/sharp-left.png'}, {id:'direction_10', url:'images/head.png'}, {id:'direction_11', url:'images/round-about.png'}, - {id:'direction_15', url:'images/target.png'} + {id:'direction_15', url:'images/target.png'}, + {id:'osrm-logo', url:'images/osrm-logo.png'}, + {id:'selector', url:'images/selector.png'} ]; for(var i=0; i= 0) + return stylesheets[i]; + } + return null; + }, + + insert: function(stylesheet, selector, rule) { + if( stylesheet.addRule ){ + stylesheet.addRule(selector, rule); + } else if( stylesheet.insertRule ){ + stylesheet.insertRule(selector + ' { ' + rule + ' }', stylesheet.cssRules.length); + } + } +}; \ No newline at end of file From 41301446870016c2e7a3a1a1e066f3e294ed302b Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 3 May 2012 15:25:58 +0100 Subject: [PATCH 09/72] removed Leaflet relative path --- WebContent/base/leaflet/L.Bugfixes.js | 6 ------ WebContent/main.js | 2 +- WebContent/utils/OSRM.CSS.js | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/WebContent/base/leaflet/L.Bugfixes.js b/WebContent/base/leaflet/L.Bugfixes.js index 6d0b0a67b..e1979df15 100644 --- a/WebContent/base/leaflet/L.Bugfixes.js +++ b/WebContent/base/leaflet/L.Bugfixes.js @@ -19,12 +19,6 @@ or see http://www.gnu.org/licenses/agpl.txt. // [assorted bugfixes to Leaflet functions we use] -// find relative leaflet URL -var i = 0; -while( L.ROOT_URL[i] == document.URL[i] ) { i++; } -L.RELATIVE_ROOT_URL = L.ROOT_URL.slice(i); - - // return closest point on segment or distance to that point L.LineUtil._sqClosestPointOnSegment = function (p, p1, p2, sqDist) { var x = p1.x, diff --git a/WebContent/main.js b/WebContent/main.js index ee9319635..12f7d0654 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -43,7 +43,7 @@ OSRM.init = function() { // prefetch images OSRM.GLOBALS.images = {}; OSRM.prefetchImages = function() { - var image_list = [ {id:'marker-shadow', url:L.RELATIVE_ROOT_URL + 'images/marker-shadow.png'}, + var image_list = [ {id:'marker-shadow', url:'leaflet/images/marker-shadow.png'}, {id:'marker-source', url:'images/marker-source.png'}, {id:'marker-target', url:'images/marker-target.png'}, {id:'marker-via', url:'images/marker-via.png'}, diff --git a/WebContent/utils/OSRM.CSS.js b/WebContent/utils/OSRM.CSS.js index 6235b3dea..03aa1d2f6 100644 --- a/WebContent/utils/OSRM.CSS.js +++ b/WebContent/utils/OSRM.CSS.js @@ -23,7 +23,6 @@ OSRM.CSS = { the_document = the_document || document; var stylesheets = the_document.styleSheets; for(var i=0, size=stylesheets.length; i= 0) return stylesheets[i]; } From b9a817ce26136ef537f8d1d3a3ebf79753d70b96 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 3 May 2012 16:26:11 +0100 Subject: [PATCH 10/72] bug with redrawing print route --- WebContent/printing/printing.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index a8c272001..00c3225f0 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -84,7 +84,8 @@ OSRM.drawMarkers = function( markers ) { // manage route OSRM.drawRoute = function( positions ) { - OSRM.G.route = new L.DashedPolyline(); + if( OSRM.G.route == undefined ) + OSRM.G.route = new L.DashedPolyline(); OSRM.G.route.setLatLngs( positions ); OSRM.G.route.setStyle( {dashed:false,clickable:false,color:'#0033FF', weight:5} ); OSRM.G.map.addLayer( OSRM.G.route ); From 57040e692450fcdf4a98f79f2e2521df56b04c2e Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 4 May 2012 08:46:14 +0100 Subject: [PATCH 11/72] minor fixes in printing for IE8 --- WebContent/printing/printing.css | 2 +- WebContent/printing/printing.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/printing/printing.css b/WebContent/printing/printing.css index f7e74e4d4..db8a09845 100644 --- a/WebContent/printing/printing.css +++ b/WebContent/printing/printing.css @@ -146,7 +146,7 @@ div.label @media print { .pagebreak { - page-break-before:always; + page-break-after:always; } .noprint { diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 0d4b0966a..37d8ada84 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -57,7 +57,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
+
 
From a3cdba5044a3513d026488442ddb22f3cee5784e Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 4 May 2012 13:05:30 +0100 Subject: [PATCH 12/72] moved localization and printing paths to (internal) variables, so it's easier to place everything in a different directory --- WebContent/localization/OSRM.Localization.js | 8 ++++++-- WebContent/printing/OSRM.Printing.js | 12 ++++++++---- WebContent/printing/printing.js | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index bab6ee258..4cf346dda 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -21,8 +21,12 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization = { +// default directory for localization files +DIRECTORY: "localization/", + +// holds currently active language current_language: OSRM.DEFAULTS.LANGUAGE, - + // initialize localization init: function() { // create dropdown menu @@ -92,7 +96,7 @@ setLanguage: function(language) { if( supported_languages[i].encoding == language) { var script = document.createElement('script'); script.type = 'text/javascript'; - script.src = "localization/OSRM.Locale."+language+".js"; + script.src = OSRM.Localization.DIRECTORY+"OSRM.Locale."+language+".js"; document.head.appendChild(script); break; } diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index e1641324c..e00aaf855 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -21,6 +21,10 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Printing = { +// directory with printing code, and base OSRM directory relative to this directory +DIRECTORY: 'printing/', +BASE_DIRECTORY: '../', + // create UI for printing in mainwindow init: function() { var icon = document.createElement('div'); @@ -106,7 +110,7 @@ show: function(response) { body += ''; body += ''; - body += ''; + body += ''; body += ""; // build route description @@ -137,7 +141,7 @@ show: function(response) { var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) ); // draw markers - print_window.OSRM.prefetchIcons( OSRM.G.images ); + print_window.OSRM.prefetchIcons( OSRM.G.images, OSRM.Printing.BASE_DIRECTORY ); print_window.OSRM.drawMarkers( OSRM.G.markers.route ); // draw route & query for better geometry @@ -164,7 +168,7 @@ openPrintWindow: function() { OSRM.G.printwindow.close(); // generate a new window and wait till it has finished loading - OSRM.G.printwindow = window.open("printing/printing.html","","width=540,height=500,left=100,top=100,dependent=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes"); + OSRM.G.printwindow = window.open( OSRM.Printing.DIRECTORY + "printing.html","","width=540,height=500,left=100,top=100,dependent=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes"); }, @@ -182,7 +186,7 @@ printWindowLoaded: function(){ ]; var stylesheet = OSRM.CSS.getStylesheet("printing.css", print_document); for(var i=0; i Date: Sun, 6 May 2012 18:36:58 +0200 Subject: [PATCH 13/72] testing route history --- WebContent/base/OSRM.Routes.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index d9bd07db9..290e043d7 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -30,7 +30,16 @@ OSRM.Route = function() { this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10}; this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10}; +// this._route_history_styles = [{dashed:false, color:'#0033FF', weight:5}, +// {dashed:false, color:'#0011DD', weight:5}, +// {dashed:false, color:'#0000BB', weight:5}, +// {dashed:false, color:'#000099', weight:5}, +// {dashed:false, color:'#000077', weight:5} +// ]; + this._noroute = OSRM.Route.ROUTE; + +// this._route_history = []; }; OSRM.Route.NOROUTE = true; OSRM.Route.ROUTE = false; @@ -38,6 +47,16 @@ OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { this._noroute = noroute; +// this._route_history.push( this._current_route ); +// if(this._route_history.length==6) { +// this._route_history[0].hide(); +// this._route_history.splice(0,1); +// } +// for(var i=0,size=this._route_history.length; i Date: Sun, 6 May 2012 18:37:23 +0200 Subject: [PATCH 14/72] added miles/feet display (without gui option at the moment) --- WebContent/OSRM.config.js | 1 + WebContent/gui/OSRM.RoutingGUI.js | 3 +++ WebContent/printing/OSRM.Printing.js | 6 ++--- WebContent/routing/OSRM.RoutingDescription.js | 6 ++--- WebContent/utils/OSRM.Utils.js | 23 +++++++++++++------ 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 730aa4115..5829ec679 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -32,6 +32,7 @@ OSRM.DEFAULTS = { ONLOAD_SOURCE: "", ONLOAD_TARGET: "", HIGHLIGHT_ZOOM_LEVEL: 16, + DISTANCE_FORMAT: 0, // 0: km, 1: miles GEOCODER_BOUNDS: '', // the world is not enough! //GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0', // bounds for Europe diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index 808081692..f8674bbb9 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -23,6 +23,9 @@ OSRM.GUI.extend( { // init init: function() { + // init variables + OSRM.G.DISTANCE_FORMAT = OSRM.DEFAULTS.DISTANCE_FORMAT; + // init events document.getElementById("gui-input-source").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.SOURCE_LABEL);}; document.getElementById("gui-delete-source").onclick = function() {OSRM.GUI.deleteMarker(OSRM.C.SOURCE_LABEL);}; diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index e00aaf855..5907af799 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -85,11 +85,11 @@ show: function(response) { '
' + '
' + '
' + OSRM.loc("DISTANCE")+':
' + - '
' + OSRM.Utils.metersToDistance(response.route_summary.total_distance) + '
' + + '
' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + '
' + '
' + '
' + OSRM.loc("DURATION")+':
' + - '
' + OSRM.Utils.secondsToTime(response.route_summary.total_time) + '
' + + '
' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + '
' + '
' + '' + @@ -123,7 +123,7 @@ show: function(response) { body += ''; if( i != response.route_instructions.length-1 ) - body += ''+OSRM.Utils.metersToDistance(response.route_instructions[i][2])+''; + body += ''+OSRM.Utils.toHumanDistance(response.route_instructions[i][2])+''; body += ""; body += ""; diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 54ad48a4c..5cfd4c779 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -92,7 +92,7 @@ show: function(response) { body += ''; if( i != response.route_instructions.length-1 ) - body += ''+OSRM.Utils.metersToDistance(response.route_instructions[i][2])+''; + body += ''+OSRM.Utils.toHumanDistance(response.route_instructions[i][2])+''; body += ""; body += ""; @@ -100,7 +100,7 @@ show: function(response) { body += ''; // build header - header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.metersToDistance(response.route_summary.total_distance), OSRM.Utils.secondsToTime(response.route_summary.total_time), route_link, gpx_link); + header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), route_link, gpx_link); // update DOM document.getElementById('information-box-header').innerHTML = header; @@ -110,7 +110,7 @@ show: function(response) { // simple description showSimple: function(response) { // build header - header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.metersToDistance(response.route_summary.total_distance), OSRM.Utils.secondsToTime(response.route_summary.total_time), "", ""); + header = OSRM.RoutingDescription._buildHeader(OSRM.Utils.toHumanDistance(response.route_summary.total_distance), OSRM.Utils.toHumanTime(response.route_summary.total_time), "", ""); // update DOM document.getElementById('information-box-header').innerHTML = header; diff --git a/WebContent/utils/OSRM.Utils.js b/WebContent/utils/OSRM.Utils.js index 9c4decdc7..b1147c259 100644 --- a/WebContent/utils/OSRM.Utils.js +++ b/WebContent/utils/OSRM.Utils.js @@ -24,7 +24,7 @@ OSRM.Utils = { // [human readabilty functions] // human readable time -secondsToTime: function(seconds){ +toHumanTime: function(seconds){ seconds = parseInt(seconds); minutes = parseInt(seconds/60); seconds = seconds%60; @@ -38,13 +38,22 @@ secondsToTime: function(seconds){ } }, //human readable distance -metersToDistance: function(distance){ - distance = parseInt(distance); +toHumanDistance: function(meters){ + var distance = parseInt(meters); - if(distance >= 100000){ return (parseInt(distance/1000))+' ' + 'km'; } - else if(distance >= 10000){ return (parseInt(distance/1000).toFixed(1))+' ' + 'km'; } - else if(distance >= 1000){ return (parseFloat(distance/1000).toFixed(2))+' ' + 'km'; } - else{ return distance+' ' + 'm'; } + if(OSRM.G.DISTANCE_FORMAT == 1) { // miles + distance = distance / 1609.344; + if(distance >= 100){ return (distance).toFixed(0)+' ' + 'mi'; } + else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'mi'; } + else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'mi'; } + else{ return (distance*5280).toFixed(0)+' ' + 'ft'; } + } else { // default to km, m + distance = distance / 1000; + if(distance >= 100){ return (distance).toFixed(0)+' ' + 'km'; } + else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'km'; } + else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'km'; } + else{ return (distance*1000).toFixed(0)+' ' + 'm'; } + } }, From 7451cc315011e57ad5f6da6079fc48d6e29e9c6f Mon Sep 17 00:00:00 2001 From: shiin Date: Sun, 6 May 2012 18:45:13 +0200 Subject: [PATCH 15/72] added Danish translation --- AUTHORS.md | 4 +- WebContent/OSRM.config.js | 1 + WebContent/localization/OSRM.Locale.da.js | 94 +++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 WebContent/localization/OSRM.Locale.da.js diff --git a/AUTHORS.md b/AUTHORS.md index e0d964b9c..5ee70cc13 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -6,4 +6,6 @@ Pascal Neis Teemu Koskinen Nicolas Belett Vigneron Moyg -Jean-Frédéric +Jean-Frederic +Zbigniew Czernik +Jonas Häggqvist \ No newline at end of file diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5829ec679..3e8701590 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -43,6 +43,7 @@ OSRM.DEFAULTS = { LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ {display_name:"en", encoding:"en"}, + {display_name:"da", encoding:"da"}, {display_name:"de", encoding:"de"}, {display_name:"fi", encoding:"fi"}, {display_name:"fr", encoding:"fr"}, diff --git a/WebContent/localization/OSRM.Locale.da.js b/WebContent/localization/OSRM.Locale.da.js new file mode 100644 index 000000000..4725d1f01 --- /dev/null +++ b/WebContent/localization/OSRM.Locale.da.js @@ -0,0 +1,94 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [Danish language support] + + +OSRM.Localization["da"] = { +//gui +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Fejl", +"GUI_START": "Start", +"GUI_END": "Destination", +"GUI_RESET": "  Nulstil  ", +"GUI_SEARCH": "  Vis  ", +"GUI_REVERSE": "Omvendt", +"GUI_OPTIONS": "Kortlægnings værktøjer", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje", +"GUI_START_TOOLTIP": "Indtast start", +"GUI_END_TOOLTIP": "Indtast destination", +"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting af KIT - Geocoder af OSM", +// geocoder +"SEARCH_RESULTS": "Søgeresultater", +"FOUND_X_RESULTS": "fandt %i resultater", +"TIMED_OUT": "Indtet svar", +"NO_RESULTS_FOUND": "Ingen resultater", +"NO_RESULTS_FOUND_SOURCE": "Ingen resultater for start", +"NO_RESULTS_FOUND_TARGET": "Ingen resultater for destination", +//routing +"ROUTE_DESCRIPTION": "Rutebeskrivelse", +"GET_LINK_TO_ROUTE": "Lav link", +"GENERATE_LINK_TO_ROUTE": "venter pÃ¥ link", +"LINK_TO_ROUTE_TIMEOUT": "ikke tilgængelig", +"GPX_FILE": "GPX Fil", +"DISTANCE": "Distance", +"DURATION": "Varighed", +"YOUR_ROUTE_IS_BEING_COMPUTED": "Din rute bliver beregnet", +"NO_ROUTE_FOUND": "Ingen mulig rute fundet", +//printing +"OVERVIEW_MAP": "Oversigtskort", +"NO_ROUTE_SELECTED": "Ikke valgte rute", +// directions +"N": "nord", +"E": "øst", +"S": "syd", +"W": "vest", +"NE": "nordøst", +"SE": "sydøst", +"SW": "sydvest", +"NW": "nordvest", +// driving directions +// %s: road name +// %d: direction +// [*]: will only be printed when there actually is a road name +"DIRECTION_0":"Unknown instruction[ on %s]", +"DIRECTION_1":"Fortsæt [ ad %s]", +"DIRECTION_2":"Drej svagt til højre [ ad %s]", +"DIRECTION_3":"Drej til højre[ ad %s]", +"DIRECTION_4":"Drej skarpt til højre[ ad %s]", +"DIRECTION_5":"U-vending[ ad %s]", +"DIRECTION_6":"Drej svagt til venstre[ ad %s]", +"DIRECTION_7":"Drej til venstre[ ad %s]", +"DIRECTION_8":"Drej skarpt til venstre[ ad %s]", +"DIRECTION_10":"Kør mod %d[ ad %s]", +"DIRECTION_11-1":"Kør ind i rundkørslen og tag første udkørsel[ ad %s]", +"DIRECTION_11-2":"Kør ind i rundkørslen og tag anden udkørsel[ ad %s]", +"DIRECTION_11-3":"Kør ind i rundkørslen og tag tredje udkørsel[ ad %s]", +"DIRECTION_11-4":"Kør ind i rundkørslen og tag fjerde udkørsel[ ad %s]", +"DIRECTION_11-5":"Kør ind i rundkørslen og tag femte udkørsel[ ad %s]", +"DIRECTION_11-6":"Kør ind i rundkørslen og tag sjette udkørsel[ ad %s]", +"DIRECTION_11-7":"Kør ind i rundkørslen og tag syvende udkørsel[ ad %s]", +"DIRECTION_11-8":"Kør ind i rundkørslen og tag ottende udkørsel[ ad %s]", +"DIRECTION_11-9":"Kør ind i rundkørslen og tag niende udkørsel[ ad %s]", +"DIRECTION_11-x":"Kør ind i rundkørslen og tag en af de alt for mange udkørsler[ ad %s]", +"DIRECTION_15":"Du er ankommet til din destination" +}; + +//set GUI language on load +if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true ) + OSRM.Localization.setLanguage("da"); From 826cbc9a241583491a467f3561c33610c31440b8 Mon Sep 17 00:00:00 2001 From: shiin Date: Sun, 6 May 2012 19:10:43 +0200 Subject: [PATCH 16/72] added parameter to set meters/miles, changed toHumanDistance functions so that conditions don't need to be checked all the time --- WebContent/gui/OSRM.RoutingGUI.js | 2 +- WebContent/main.js | 6 +++ WebContent/routing/OSRM.RoutingDescription.js | 1 + WebContent/utils/OSRM.Utils.js | 41 +++++++++++-------- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index f8674bbb9..5004c6236 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -24,7 +24,7 @@ OSRM.GUI.extend( { // init init: function() { // init variables - OSRM.G.DISTANCE_FORMAT = OSRM.DEFAULTS.DISTANCE_FORMAT; + OSRM.Utils.setToHumanDistanceFunction(OSRM.DEFAULTS.DISTANCE_FORMAT); // init events document.getElementById("gui-input-source").onchange = function() {OSRM.GUI.inputChanged(OSRM.C.SOURCE_LABEL);}; diff --git a/WebContent/main.js b/WebContent/main.js index 12f7d0654..cd14bc3b4 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -165,6 +165,12 @@ OSRM.parseParameters = function(){ if(name_val[0] == 'hl') { OSRM.Localization.setLanguage(name_val[1]); } + else if(name_val[0] == 'df') { + var type = parseInt(name_val[1]); + if(type != 0 && type != 1) + return; + OSRM.Utils.setToHumanDistanceFunction(type); + } else if(name_val[0] == 'loc') { var coordinates = unescape(name_val[1]).split(','); if(coordinates.length!=2 || !OSRM.Utils.isLatitude(coordinates[0]) || !OSRM.Utils.isLongitude(coordinates[1]) ) diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 5cfd4c779..88dd69ce9 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -31,6 +31,7 @@ onClickRouteDescription: function(geometry_index) { }, onClickCreateShortcut: function(src){ src += '&z='+ OSRM.G.map.getZoom() + '¢er=' + OSRM.G.map.getCenter().lat.toFixed(6) + ',' + OSRM.G.map.getCenter().lng.toFixed(6); + src += '&df=' + OSRM.G.DISTANCE_FORMAT; var source = OSRM.DEFAULTS.SHORTENER_PARAMETERS.replace(/%url/, OSRM.DEFAULTS.HOST_SHORTENER_URL+src); diff --git a/WebContent/utils/OSRM.Utils.js b/WebContent/utils/OSRM.Utils.js index b1147c259..ea544ed8e 100644 --- a/WebContent/utils/OSRM.Utils.js +++ b/WebContent/utils/OSRM.Utils.js @@ -31,30 +31,39 @@ toHumanTime: function(seconds){ hours = parseInt(minutes/60); minutes = minutes%60; if(hours==0){ - return minutes + ' ' + 'min'; + return minutes + ' ' + 'min'; } else{ - return hours + ' ' + 'h' + ' ' + minutes + ' ' + 'min'; + return hours + ' ' + 'h' + ' ' + minutes + ' ' + 'min'; } }, //human readable distance -toHumanDistance: function(meters){ +setToHumanDistanceFunction: function(type) { + OSRM.G.DISTANCE_FORMAT = type; + if( type == 1 ) + OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMiles; + else + OSRM.Utils.toHumanDistance = OSRM.Utils.toHumanDistanceMeters; +}, +toHumanDistanceMeters: function(meters){ var distance = parseInt(meters); - if(OSRM.G.DISTANCE_FORMAT == 1) { // miles - distance = distance / 1609.344; - if(distance >= 100){ return (distance).toFixed(0)+' ' + 'mi'; } - else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'mi'; } - else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'mi'; } - else{ return (distance*5280).toFixed(0)+' ' + 'ft'; } - } else { // default to km, m - distance = distance / 1000; - if(distance >= 100){ return (distance).toFixed(0)+' ' + 'km'; } - else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'km'; } - else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'km'; } - else{ return (distance*1000).toFixed(0)+' ' + 'm'; } - } + distance = distance / 1000; + if(distance >= 100){ return (distance).toFixed(0)+' ' + 'km'; } + else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'km'; } + else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'km'; } + else{ return (distance*1000).toFixed(0)+' ' + 'm'; } }, +toHumanDistanceMiles: function(meters){ + var distance = parseInt(meters); + + distance = distance / 1609.344; + if(distance >= 100){ return (distance).toFixed(0)+' ' + 'mi'; } + else if(distance >= 10){ return (distance).toFixed(1)+' ' + 'mi'; } + else if(distance >= 0.1){ return (distance).toFixed(2)+' ' + 'mi'; } + else{ return (distance*5280).toFixed(0)+' ' + 'ft'; } +}, +toHumanDistance: null, // [verification routines] From 6c1c830c0dd357fe6e3ee156d2c367428604605c Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 8 May 2012 10:23:22 +0100 Subject: [PATCH 17/72] commented out stuff --- WebContent/base/OSRM.Routes.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 290e043d7..02e75f2fb 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -36,17 +36,16 @@ OSRM.Route = function() { // {dashed:false, color:'#000099', weight:5}, // {dashed:false, color:'#000077', weight:5} // ]; +// this._route_history = []; this._noroute = OSRM.Route.ROUTE; - -// this._route_history = []; }; OSRM.Route.NOROUTE = true; OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { - this._noroute = noroute; +// if(!this._noroute) { // this._route_history.push( this._current_route ); // if(this._route_history.length==6) { // this._route_history[0].hide(); @@ -57,6 +56,8 @@ OSRM.extend( OSRM.Route,{ // this._route_history[i].show(); // } // this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} ); +// } + this._noroute = noroute; this._current_route.setPositions( positions ); if ( this._noroute == OSRM.Route.NOROUTE ) this._current_route.setStyle( this._current_noroute_style ); From 50aea3310af76e90807e24833fa56d09ae7c47a6 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 8 May 2012 13:32:44 +0100 Subject: [PATCH 18/72] fixed bug that caused wrong destinations when clicking on a routing instruction after zooming --- WebContent/routing/OSRM.RoutingDescription.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 88dd69ce9..5711c040f 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -22,10 +22,8 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.RoutingDescription = { // route description events -onClickRouteDescription: function(geometry_index) { - var positions = OSRM.G.route.getPositions(); - - OSRM.G.markers.highlight.setPosition( positions[geometry_index] ); +onClickRouteDescription: function(lat, lng) { + OSRM.G.markers.highlight.setPosition( new L.LatLng(lat, lng) ); OSRM.G.markers.highlight.show(); OSRM.G.markers.highlight.centerView(OSRM.DEFAULTS.HIGHLIGHT_ZOOM_LEVEL); }, @@ -65,8 +63,8 @@ show: function(response) { var gpx_link = '['+OSRM.loc("GPX_FILE")+']'; // create route description + var positions = OSRM.G.route.getPositions(); var body = ""; - body += ''; for(var i=0; i < response.route_instructions.length; i++){ //odd or even ? @@ -80,7 +78,8 @@ show: function(response) { body += ''; body += ''; +// var header = +// ''; // create route description var body = ''; @@ -122,8 +159,7 @@ show: function(response) { body += ""; body += '"; body += ""; @@ -141,7 +177,7 @@ show: function(response) { var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) ); // draw markers - print_window.OSRM.prefetchIcons( OSRM.G.images, OSRM.Printing.BASE_DIRECTORY ); + print_window.OSRM.prefetchIcons( OSRM.G.images ); print_window.OSRM.drawMarkers( OSRM.G.markers.route ); // draw route & query for better geometry diff --git a/WebContent/printing/printing.css b/WebContent/printing/printing.css index db8a09845..62cce0f81 100644 --- a/WebContent/printing/printing.css +++ b/WebContent/printing/printing.css @@ -192,7 +192,7 @@ div.label } .medium-font { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10.5px; + font-size: 10.5px; /* will be 10px in IE quirks mode */ font-weight: normal; } .small-font { diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 37d8ada84..079362dec 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -28,6 +28,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM Website + diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index 37bfd8063..c3e2a8002 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -32,7 +32,7 @@ function printWindow() { //prefetch icons OSRM.GLOBALS.icons = {}; -OSRM.prefetchIcons = function(images_list, BASE_DIRECTORY) { +OSRM.prefetchIcons = function(images_list) { var icon_list = [ {id:'marker-source', image_id:'marker-source'}, {id:'marker-target', image_id:'marker-target'}, {id:'marker-via', image_id:'marker-via'}, @@ -41,8 +41,9 @@ OSRM.prefetchIcons = function(images_list, BASE_DIRECTORY) { for(var i=0; i Date: Tue, 8 May 2012 15:58:54 +0100 Subject: [PATCH 20/72] added functions for binding functions to a context and for concating them --- WebContent/utils/OSRM.classes.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/WebContent/utils/OSRM.classes.js b/WebContent/utils/OSRM.classes.js index 4b21d653c..b97be6770 100644 --- a/WebContent/utils/OSRM.classes.js +++ b/WebContent/utils/OSRM.classes.js @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see http://www.gnu.org/licenses/agpl.txt. */ -// OSRM base class -// [support for inheritance] +// OSRM classes +// [support for inheritance and other function related functionality] // declare one class to be a subclass of another class // (runs anonymous function to prevent local functions cluttering global namespace) @@ -39,6 +39,24 @@ OSRM.extend = function( target_class, properties ) { }; +// bind a function to an execution context, i.e. an object (needed for correcting this pointers) +OSRM.bind = function( context, fct1, fct2 ) { + return function() { + if(fct1) fct1.apply(context, arguments); + if(fct2) fct2.apply(context, arguments); + }; +}; + + +// concatenate the execution of two functions with the same set of parameters +OSRM.concat = function( fct1, fct2 ) { + return function() { + fct1.apply(this,arguments); + fct2.apply(this,arguments); + }; +}; + + // [usage of convenience functions] // SubClass = function() { // SubClass.prototype.base.constructor.apply(this, arguments); From 884f79a620c03ab9644ffd0bcfede7ad9b8a0725 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 8 May 2012 16:58:08 +0100 Subject: [PATCH 21/72] new handling of gui boxes (work in progress) --- WebContent/base/OSRM.Map.js | 4 +- WebContent/base/osrm/OSRM.MapView.js | 16 ++-- WebContent/gui/OSRM.GUIBoxGroup.js | 44 ++++++++++ WebContent/gui/OSRM.GUIBoxHandle.js | 127 +++++++++++++++++++++++++++ WebContent/gui/OSRM.MainGUI.js | 65 ++++---------- WebContent/main.css | 84 +++++++++++------- WebContent/main.html | 30 ++++--- WebContent/main.js | 28 +++--- 8 files changed, 288 insertions(+), 110 deletions(-) create mode 100644 WebContent/gui/OSRM.GUIBoxGroup.js create mode 100644 WebContent/gui/OSRM.GUIBoxHandle.js diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index e26edb31c..78c77ac28 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -29,7 +29,7 @@ OSRM.Map = { // map initialization init: function() { // check if GUI is initialized! - if(OSRM.GUI.visible == null) + if(OSRM.G.main_handle == null) OSRM.GUI.init(); // setup tile servers @@ -54,7 +54,7 @@ init: function() { OSRM.G.map.addLayerControl(layerControl); // move zoom markers - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.GUI.width+10)+"px"; + OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.G.main_handle.boxWidth()+10)+"px"; OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.top="5px"; // map events diff --git a/WebContent/base/osrm/OSRM.MapView.js b/WebContent/base/osrm/OSRM.MapView.js index 110eb249f..bceea9f1c 100644 --- a/WebContent/base/osrm/OSRM.MapView.js +++ b/WebContent/base/osrm/OSRM.MapView.js @@ -19,9 +19,9 @@ or see http://www.gnu.org/licenses/agpl.txt. // [extending Leaflet L.Map with setView/fitBounds methods that respect UI visibility, better layerControl] OSRM.MapView = L.Map.extend({ setViewUI: function(position, zoom, no_animation) { - if( OSRM.GUI.visible == true ) { + if( OSRM.G.main_handle.boxVisible() ) { var point = this.project( position, zoom); - point.x-=OSRM.GUI.width/2; + point.x-=OSRM.G.main_handle.boxWidth()/2; position = this.unproject(point,zoom); } this.setView( position, zoom, no_animation); @@ -31,8 +31,8 @@ OSRM.MapView = L.Map.extend({ var northeast = bounds.getNorthEast(); var zoom = this.getBoundsZoom(bounds); var sw_point = this.project( southwest, zoom); - if( OSRM.GUI.visible == true ) - sw_point.x-=OSRM.GUI.width+20; + if( OSRM.G.main_handle.boxVisible() ) + sw_point.x-=OSRM.G.main_handle.boxWidth()+20; else sw_point.x-=20; sw_point.y+=20; @@ -45,16 +45,16 @@ OSRM.MapView = L.Map.extend({ }, getBoundsUI: function(unbounded) { var bounds = this.getPixelBounds(); - if( OSRM.GUI.visible == true ) - bounds.min.x+=OSRM.GUI.width; + if( OSRM.G.main_handle.boxVisible() ) + bounds.min.x+=OSRM.G.main_handle.boxWidth(); var sw = this.unproject(new L.Point(bounds.min.x, bounds.max.y), this._zoom, true), ne = this.unproject(new L.Point(bounds.max.x, bounds.min.y), this._zoom, true); return new L.LatLngBounds(sw, ne); }, getCenterUI: function(unbounded) { var viewHalf = this.getSize(); - if( OSRM.GUI.visible == true ) - viewHalf.x += OSRM.GUI.width; + if( OSRM.G.main_handle.boxVisible() ) + viewHalf.x += OSRM.G.main_handle.boxWidth(); var centerPoint = this._getTopLeftPoint().add(viewHalf.divideBy(2)); return this.unproject(centerPoint, this._zoom, unbounded); diff --git a/WebContent/gui/OSRM.GUIBoxGroup.js b/WebContent/gui/OSRM.GUIBoxGroup.js new file mode 100644 index 000000000..972c6e907 --- /dev/null +++ b/WebContent/gui/OSRM.GUIBoxGroup.js @@ -0,0 +1,44 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM MainGUI +// [handles all GUI events that interact with appearance of main window] + + +// OSRM GUIBoxGroup +// [group UI boxes so that handles can be shown/hidden together] + +OSRM.GUIBoxGroup = function() { + this._handles = []; +}; + +OSRM.extend( OSRM.GUIBoxGroup, { +add: function( handle ) { + this._handles.push( handle ); + handle.addToGroup(this); +}, +hide: function() { + for(var i=0; i< this._handles.length; i++) { + this._handles[i].hide(); + } +}, +show: function() { + for(var i=0; i< this._handles.length; i++) { + this._handles[i].show(); + } +} +}); \ No newline at end of file diff --git a/WebContent/gui/OSRM.GUIBoxHandle.js b/WebContent/gui/OSRM.GUIBoxHandle.js new file mode 100644 index 000000000..23a647406 --- /dev/null +++ b/WebContent/gui/OSRM.GUIBoxHandle.js @@ -0,0 +1,127 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM GUIBoxHandle +// [performs showing and hiding of UI boxes] + +OSRM.GUIBoxHandle = function( box_name, side, cssText, transitionStartFct, transitionEndFct ) { + // do not create handle if box does not contain a toggle button + var toggle = document.getElementById( box_name + '-toggle'); + if( toggle == null ) { + console.log("[error] No toggle button for " + box_name); + return; + } + + // create DOM elements + var wrapper = document.createElement('div'); + wrapper.id = box_name + '-handle-wrapper'; + wrapper.className = 'not-selectable box-wrapper box-handle-wrapper-'+side; + wrapper.style.cssText += cssText; + var content = document.createElement('div'); + content.id = box_name + '-handle-content'; + content.className = 'box-content box-handle-content-'+side; + var icon = document.createElement('div'); + icon.id = box_name + '-handle-icon'; + icon.className = 'iconic-button'; + + content.appendChild(icon); + wrapper.appendChild(content); + document.body.appendChild(wrapper); + + // create attributes + this._box = document.getElementById( box_name + '-wrapper' ); + this._width = this._box.clientWidth; + this._handle = wrapper; + this._box_group = null; + + // show or hide + if(side=="left") { + this._box_visible = true; + this._handle.style.visibility="hidden"; + } else { + this._box_visible = false; + this._handle.style.visibility="visible"; + } + + // add functionality + var toggle_fct = side == "left" ? this._toggleLeft : this._toggleRight; + var full_fct = transitionStartFct ? OSRM.concat(toggle_fct, transitionStartFct) : toggle_fct; + var fct = OSRM.bind( this, full_fct ); + toggle.onclick = fct; + icon.onclick = fct; + + var full_fct = transitionEndFct ? OSRM.concat(this._onTransitionEnd, transitionEndFct) : this._onTransitionEnd; + var fct = OSRM.bind( this, full_fct ); + if( OSRM.Browser.FF3==-1 && OSRM.Browser.IE6_9==-1 ) { + var box_wrapper = document.getElementById(box_name + '-wrapper'); + box_wrapper.addEventListener("transitionend", fct, false); + box_wrapper.addEventListener("webkitTransitionEnd", fct, false); + box_wrapper.addEventListener("oTransitionEnd", fct, false); + box_wrapper.addEventListener("MSTransitionEnd", fct, false); + } else { + this._transitionEndFct = fct; + } +}; + +OSRM.extend( OSRM.GUIBoxHandle, { +addToGroup: function(group) { + this._box_group = group; +}, +show: function() { + this._handle.style.visibility="visible"; +}, +hide: function() { + this._handle.style.visibility="hidden"; +}, +boxVisible: function() { + return this._box_visible; +}, +boxWidth: function() { + return this._width; +}, + +_toggleLeft: function() { + if( this._box_visible == false ) { + if(this._box_group) this._box_group.hide(); else this.hide(); + this._box.style.left="5px"; + } else { + this._box.style.left=-this._width+"px"; + } + // old browser support + if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) + setTimeout(this._transitionEndFct, 0); +}, +_toggleRight: function() { + if( this._box_visible == false ) { + if(this._box_group) this._box_group.hide(); else this.hide(); + this._box.style.right="5px"; + } else { + this._box.style.right=-this._width+"px"; + } + // old browser support + if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) + setTimeout(this._transitionEndFct, 0); +}, +_onTransitionEnd: function() { + if( this._box_visible == true ) { + if(this._box_group) this._box_group.show(); else this.show(); + this._box_visible = false; + } else { + this._box_visible = true; + } +} +}); \ No newline at end of file diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index bd3875c54..6fa7af179 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -21,31 +21,22 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.GUI.extend( { -// defaults -visible: null, -width: null, - // init GUI init: function() { - OSRM.GUI.visible = true; - OSRM.GUI.width = document.getElementById("main-wrapper").clientWidth; + // init main box + OSRM.G.main_handle = new OSRM.GUIBoxHandle("main", "left", "left:-5px;top:5px;", OSRM.GUI.beforeMainTransition, OSRM.GUI.afterMainTransition); + + // init additional boxes + var option_group = new OSRM.GUIBoxGroup(); + var config_handle = new OSRM.GUIBoxHandle("config", "right", "right:-5px;bottom:70px;"); + var mapping_handle = new OSRM.GUIBoxHandle("mapping", "right", "right:-5px;bottom:25px;"); + option_group.add( config_handle ); + option_group.add( mapping_handle ); // init starting source/target document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE; document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET; - // init events - document.getElementById("gui-toggle-in").onclick = OSRM.GUI.toggleMain; - document.getElementById("gui-toggle-out").onclick = OSRM.GUI.toggleMain; - - // gui after transition events - 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); - } - // set default language OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); }, @@ -67,13 +58,13 @@ setLabels: function() { document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); }, -//clear output area +// clear output area clearResults: function() { document.getElementById('information-box').innerHTML = ""; document.getElementById('information-box-header').innerHTML = ""; }, -//show/hide small options bubble +// show/hide small options bubble toggleOptions: function() { if(document.getElementById('options-box').style.visibility=="visible") { document.getElementById('options-box').style.visibility="hidden"; @@ -82,40 +73,20 @@ toggleOptions: function() { } }, -// show/hide main-gui -toggleMain: function() { - // show main-gui - if( OSRM.GUI.visible == false ) { +// reposition and hide zoom controls before main box animation +beforeMainTransition: function() { + if( OSRM.G.main_handle.boxVisible() == false ) { OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="hidden"; - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.GUI.width+10)+"px";; - - document.getElementById('blob-wrapper').style.visibility="hidden"; - document.getElementById('main-wrapper').style.left="5px"; - // hide main-gui + OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.G.main_handle.boxWidth()+10)+"px"; } else { OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="hidden"; OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left="30px"; - - document.getElementById('main-wrapper').style.left=-OSRM.GUI.width+"px"; } - - // execute after animation (old browser support) - if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) - OSRM.GUI._onMainTransitionEnd(); }, -// do stuff after main-gui animation finished -_onMainTransitionEnd: function() { - // after hiding main-gui - if( OSRM.GUI.visible == true ) { - document.getElementById('blob-wrapper').style.visibility="visible"; - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; - OSRM.GUI.visible = false; - // after showing main-gui - } else { - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; - OSRM.GUI.visible = true; - } +// show zoom controls after main box animation +afterMainTransition: function() { + OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; } }); diff --git a/WebContent/main.css b/WebContent/main.css index 62905c5a5..bfffe0a0e 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -23,6 +23,7 @@ html, body { padding: 0; margin: 0; height: 100%; + overflow:hidden; } #map { height: 100%; @@ -31,7 +32,7 @@ html, body { /* general styles for gui boxes */ -.gui-wrapper +.box-wrapper { position:absolute; border-radius:10px; @@ -39,13 +40,13 @@ html, body { -webkit-border-radius:10px; background-color:#666666; background-color:rgba(0, 0, 0, 0.25); - transition:left 1s; - -moz-transition:left 1s; - -webkit-transition:left 1s; - -o-transition:left 1s; - -ms-transition:left 1s; + transition:left 1s, right 1s; + -moz-transition:left 1s,right 1s; + -webkit-transition:left 1s,right 1s; + -o-transition:left 1s,right 1s; + -ms-transition:left 1s,right 1s; } -.gui-box +.box-content { position:absolute; background-color:#ffffff; @@ -56,6 +57,50 @@ html, body { margin:5px; padding:5px; } +.box-handle-wrapper-right +{ + width:36px; + height:36px; + border-top-right-radius:0px; + border-bottom-right-radius:0px; + -moz-border-radius-topright:0px; + -moz-border-radius-bottomright:0px; + -webkit-border-top-right-radius:0px; + -webkit-border-bottom-right-radius:0px; +} +.box-handle-content-right +{ + width:16px; + height:16px; + border-top-right-radius:0px; + border-bottom-right-radius:0px; + -moz-border-radius-topright:0px; + -moz-border-radius-bottomright:0px; + -webkit-border-top-right-radius:0px; + -webkit-border-bottom-right-radius:0px; +} +.box-handle-wrapper-left +{ + width:36px; + height:36px; + border-top-left-radius:0px; + border-bottom-left-radius:0px; + -moz-border-radius-topleft:0px; + -moz-border-radius-bottomleft:0px; + -webkit-border-top-left-radius:0px; + -webkit-border-bottom-left-radius:0px; +} +.box-handle-content-left +{ + width:16px; + height:16px; + border-top-left-radius:0px; + border-bottom-left-radius:0px; + -moz-border-radius-topleft:0px; + -moz-border-radius-bottomleft:0px; + -webkit-border-top-left-radius:0px; + -webkit-border-bottom-left-radius:0px; +} /* styles for specific gui boxes */ @@ -77,31 +122,6 @@ html, body { top:220px; /* main-input.height+2*gui-box.margin+2*gui-box.padding */ bottom:0px; } -#blob-wrapper -{ - left:-5px; - top:5px; - width:36px; - height:36px; - border-top-left-radius:0px; - border-bottom-left-radius:0px; - -moz-border-radius-topleft:0px; - -moz-border-radius-bottomleft:0px; - -webkit-border-top-left-radius:0px; - -webkit-border-bottom-left-radius:0px; - visibility:hidden; -} -#blob-content -{ - width:16px; - height:16px; - border-top-left-radius:0px; - border-bottom-left-radius:0px; - -moz-border-radius-topleft:0px; - -moz-border-radius-bottomleft:0px; - -webkit-border-top-left-radius:0px; - -webkit-border-bottom-left-radius:0px; -} /* styles for main-input areas */ diff --git a/WebContent/main.html b/WebContent/main.html index 5be9ea0fc..3cb0096a0 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -58,6 +58,8 @@ or see http://www.gnu.org/licenses/agpl.txt. + + @@ -81,21 +83,28 @@ or see http://www.gnu.org/licenses/agpl.txt.
- -
-
-
+
+
+
+Config block +
+
+ +
+
+
+Mapping block
-
+
-
+
-
+
@@ -106,13 +115,13 @@ or see http://www.gnu.org/licenses/agpl.txt.
Start:
-
+
End:
-
+
@@ -149,13 +158,12 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
+
- diff --git a/WebContent/main.js b/WebContent/main.js index cd14bc3b4..fb633c62a 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -121,17 +121,25 @@ OSRM.prefetchCSSIcons = function() { { id:'#gui-printer', image_id:'printer'}, { id:'#gui-printer:hover', image_id:'printer_hover'}, { id:'#gui-printer:active', image_id:'printer_active'}, - { id:'#gui-toggle-in', image_id:'restore'}, - { id:'#gui-toggle-in:hover', image_id:'restore_hover'}, - { id:'#gui-toggle-in:active', image_id:'restore_active'}, - { id:'#gui-toggle-out', image_id:'cancel'}, - { id:'#gui-toggle-out:hover', image_id:'cancel_hover'}, - { id:'#gui-toggle-out:active', image_id:'cancel_active'}, - { id:'.delete-marker', image_id:'cancel'}, - { id:'.delete-marker:hover', image_id:'cancel_hover'}, - { id:'.delete-marker:active', image_id:'cancel_active'}, + + { id:'.cancel-marker', image_id:'cancel'}, + { id:'.cancel-marker:hover', image_id:'cancel_hover'}, + { id:'.cancel-marker:active', image_id:'cancel_active'}, + { id:'#input-mask-header', image_id:'osrm-logo'}, - { id:'.styled-select', image_id:'selector'} + { id:'.styled-select', image_id:'selector'}, + + { id:'#config-handle-icon', image_id:'cancel'}, + { id:'#config-handle-icon:hover', image_id:'cancel_hover'}, + { id:'#config-handle-icon:active', image_id:'cancel_active'}, + + { id:'#mapping-handle-icon', image_id:'cancel'}, + { id:'#mapping-handle-icon:hover', image_id:'cancel_hover'}, + { id:'#mapping-handle-icon:active', image_id:'cancel_active'}, + + { id:'#main-handle-icon', image_id:'restore'}, + { id:'#main-handle-icon:hover', image_id:'restore_hover'}, + { id:'#main-handle-icon:active', image_id:'restore_active'} ]; var stylesheet = OSRM.CSS.getStylesheet("main.css"); From 2d956983a51793161f372f5c9096589fc6eed611 Mon Sep 17 00:00:00 2001 From: shiin Date: Tue, 8 May 2012 20:52:41 +0200 Subject: [PATCH 22/72] finished new box design --- WebContent/gui/OSRM.GUIBoxGroup.js | 19 +++++-- WebContent/gui/OSRM.GUIBoxHandle.js | 83 +++++++++++++++-------------- WebContent/gui/OSRM.MainGUI.js | 22 ++++---- WebContent/main.css | 3 ++ 4 files changed, 72 insertions(+), 55 deletions(-) diff --git a/WebContent/gui/OSRM.GUIBoxGroup.js b/WebContent/gui/OSRM.GUIBoxGroup.js index 972c6e907..e1987529e 100644 --- a/WebContent/gui/OSRM.GUIBoxGroup.js +++ b/WebContent/gui/OSRM.GUIBoxGroup.js @@ -29,16 +29,25 @@ OSRM.GUIBoxGroup = function() { OSRM.extend( OSRM.GUIBoxGroup, { add: function( handle ) { this._handles.push( handle ); - handle.addToGroup(this); + handle.$addToGroup(this); }, -hide: function() { +select: function( handle ) { for(var i=0; i< this._handles.length; i++) { - this._handles[i].hide(); + if( this._handles[i] != handle ) + this._handles[i].$hideBox(); + else + this._handles[i].$showBox(); } }, -show: function() { + +$hide: function() { for(var i=0; i< this._handles.length; i++) { - this._handles[i].show(); + this._handles[i].$hide(); + } +}, +$show: function() { + for(var i=0; i< this._handles.length; i++) { + this._handles[i].$show(); } } }); \ No newline at end of file diff --git a/WebContent/gui/OSRM.GUIBoxHandle.js b/WebContent/gui/OSRM.GUIBoxHandle.js index 23a647406..682f8b1e1 100644 --- a/WebContent/gui/OSRM.GUIBoxHandle.js +++ b/WebContent/gui/OSRM.GUIBoxHandle.js @@ -18,7 +18,7 @@ or see http://www.gnu.org/licenses/agpl.txt. // OSRM GUIBoxHandle // [performs showing and hiding of UI boxes] -OSRM.GUIBoxHandle = function( box_name, side, cssText, transitionStartFct, transitionEndFct ) { +OSRM.GUIBoxHandle = function( box_name, side, css, transitionStartFct, transitionEndFct ) { // do not create handle if box does not contain a toggle button var toggle = document.getElementById( box_name + '-toggle'); if( toggle == null ) { @@ -26,11 +26,11 @@ OSRM.GUIBoxHandle = function( box_name, side, cssText, transitionStartFct, trans return; } - // create DOM elements + // create handle DOM elements var wrapper = document.createElement('div'); wrapper.id = box_name + '-handle-wrapper'; wrapper.className = 'not-selectable box-wrapper box-handle-wrapper-'+side; - wrapper.style.cssText += cssText; + wrapper.style.cssText += css; var content = document.createElement('div'); content.id = box_name + '-handle-content'; content.className = 'box-content box-handle-content-'+side; @@ -44,22 +44,20 @@ OSRM.GUIBoxHandle = function( box_name, side, cssText, transitionStartFct, trans // create attributes this._box = document.getElementById( box_name + '-wrapper' ); + this._class = this._box.className; this._width = this._box.clientWidth; + this._side = side; this._handle = wrapper; this._box_group = null; + this._transitionEndFct = transitionEndFct; + + // hide box and show handle by default + this._box.style[this._side]=-this._width+"px"; + this._box_visible = false; + this._handle.style.visibility="visible"; - // show or hide - if(side=="left") { - this._box_visible = true; - this._handle.style.visibility="hidden"; - } else { - this._box_visible = false; - this._handle.style.visibility="visible"; - } - // add functionality - var toggle_fct = side == "left" ? this._toggleLeft : this._toggleRight; - var full_fct = transitionStartFct ? OSRM.concat(toggle_fct, transitionStartFct) : toggle_fct; + var full_fct = transitionStartFct ? OSRM.concat(this._toggle, transitionStartFct) : this._toggle; var fct = OSRM.bind( this, full_fct ); toggle.onclick = fct; icon.onclick = fct; @@ -73,20 +71,11 @@ OSRM.GUIBoxHandle = function( box_name, side, cssText, transitionStartFct, trans box_wrapper.addEventListener("oTransitionEnd", fct, false); box_wrapper.addEventListener("MSTransitionEnd", fct, false); } else { - this._transitionEndFct = fct; + this._legacyTransitionEndFct = fct; // legacy browser support } }; OSRM.extend( OSRM.GUIBoxHandle, { -addToGroup: function(group) { - this._box_group = group; -}, -show: function() { - this._handle.style.visibility="visible"; -}, -hide: function() { - this._handle.style.visibility="hidden"; -}, boxVisible: function() { return this._box_visible; }, @@ -94,31 +83,43 @@ boxWidth: function() { return this._width; }, -_toggleLeft: function() { - if( this._box_visible == false ) { - if(this._box_group) this._box_group.hide(); else this.hide(); - this._box.style.left="5px"; - } else { - this._box.style.left=-this._width+"px"; - } - // old browser support - if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) - setTimeout(this._transitionEndFct, 0); +$addToGroup: function(group) { + this._box_group = group; }, -_toggleRight: function() { +$show: function() { + this._handle.style.visibility="visible"; +}, +$hide: function() { + this._handle.style.visibility="hidden"; +}, +$showBox: function() { + this._box_visible = true; + this._handle.style.visibility="hidden"; + this._box.style[this._side]="5px"; + this._transitionEndFct(); +}, +$hideBox: function() { + this._box_visible = false; + this._handle.style.visibility="visible"; + this._box.style[this._side]=-this._width+"px"; +}, + +_toggle: function() { + this._box.className += " box-animated"; if( this._box_visible == false ) { - if(this._box_group) this._box_group.hide(); else this.hide(); - this._box.style.right="5px"; + this._box_group.$hide(); + this._box.style[this._side]="5px"; } else { - this._box.style.right=-this._width+"px"; + this._box.style[this._side]=-this._width+"px"; } - // old browser support + // legacy browser support if( OSRM.Browser.FF3!=-1 || OSRM.Browser.IE6_9!=-1 ) - setTimeout(this._transitionEndFct, 0); + setTimeout(this._legacyTransitionEndFct, 0); }, _onTransitionEnd: function() { + this._box.className = this._class; if( this._box_visible == true ) { - if(this._box_group) this._box_group.show(); else this.show(); + this._box_group.$show(); this._box_visible = false; } else { this._box_visible = true; diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 6fa7af179..ab8f81c13 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -24,14 +24,18 @@ OSRM.GUI.extend( { // init GUI init: function() { // init main box + var main_group = new OSRM.GUIBoxGroup(); OSRM.G.main_handle = new OSRM.GUIBoxHandle("main", "left", "left:-5px;top:5px;", OSRM.GUI.beforeMainTransition, OSRM.GUI.afterMainTransition); + main_group.add( OSRM.G.main_handle ); + main_group.select( OSRM.G.main_handle ); // init additional boxes var option_group = new OSRM.GUIBoxGroup(); var config_handle = new OSRM.GUIBoxHandle("config", "right", "right:-5px;bottom:70px;"); var mapping_handle = new OSRM.GUIBoxHandle("mapping", "right", "right:-5px;bottom:25px;"); option_group.add( config_handle ); - option_group.add( mapping_handle ); + option_group.add( mapping_handle ); + option_group.select( null ); // init starting source/target document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE; @@ -75,18 +79,18 @@ toggleOptions: function() { // reposition and hide zoom controls before main box animation beforeMainTransition: function() { - if( OSRM.G.main_handle.boxVisible() == false ) { - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="hidden"; - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left=(OSRM.G.main_handle.boxWidth()+10)+"px"; - } else { - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="hidden"; - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.left="30px"; - } + var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom'); + if( zoom_controls.length > 0) + zoom_controls[0].style.visibility="hidden"; }, // show zoom controls after main box animation afterMainTransition: function() { - OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom')[0].style.visibility="visible"; + var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom'); + if( zoom_controls.length > 0) { + zoom_controls[0].style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px"; + zoom_controls[0].style.visibility="visible"; + } } }); diff --git a/WebContent/main.css b/WebContent/main.css index bfffe0a0e..12cc92195 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -40,6 +40,9 @@ html, body { -webkit-border-radius:10px; background-color:#666666; background-color:rgba(0, 0, 0, 0.25); +} +.box-animated +{ transition:left 1s, right 1s; -moz-transition:left 1s,right 1s; -webkit-transition:left 1s,right 1s; From c8912ad6ee9ef8ed15dbfeb1d207dac15224608b Mon Sep 17 00:00:00 2001 From: shiin Date: Tue, 8 May 2012 21:40:55 +0200 Subject: [PATCH 23/72] fixed printing bug in IE8 --- WebContent/printing/OSRM.Printing.js | 84 +++++++++++++++------------- WebContent/printing/printing.css | 6 +- WebContent/printing/printing.html | 2 +- WebContent/printing/printing.js | 5 +- WebContent/utils/OSRM.browsers.js | 1 + 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index e6e313fa1..9f2140fb2 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -61,8 +61,10 @@ deactivate: function() { // use hide route as trigger // create UI in printwindow show: function(response) { - // create header (using tables for compatibility with IE quirks mode) - var header = + // create header + var header; + if( OSRM.Browser.IE6_8 ) { // tables used for compatibility with legacy IE (quirks mode) + header = '
'; -// var header = -// ''; + ''; + } else { + header = + ''; + } // create route description var body = ''; diff --git a/WebContent/printing/printing.css b/WebContent/printing/printing.css index 62cce0f81..9b9d75bb5 100644 --- a/WebContent/printing/printing.css +++ b/WebContent/printing/printing.css @@ -182,17 +182,17 @@ div.label @media screen { .base-font { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; + font-size: 13px; font-weight: normal; } .big-font { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; + font-size: 15px; font-weight: bold; } .medium-font { font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10.5px; /* will be 10px in IE quirks mode */ + font-size: 11px; font-weight: normal; } .small-font { diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 079362dec..388c9a3e2 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -28,7 +28,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM Website - + diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index c3e2a8002..094867bbd 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -19,8 +19,7 @@ or see http://www.gnu.org/licenses/agpl.txt. // [for printing window] OSRM = {}; -OSRM.GLOBALS = {}; -OSRM.GUI = { visible:false }; +OSRM.GLOBALS = { main_handle:{boxVisible:function(){return false;}} }; // needed for fitBoundsUI to work OSRM.G = OSRM.GLOBALS; @@ -41,7 +40,7 @@ OSRM.prefetchIcons = function(images_list) { for(var i=0; i Date: Tue, 8 May 2012 22:37:27 +0200 Subject: [PATCH 24/72] moving UI to new boxes --- WebContent/gui/OSRM.MainGUI.js | 10 ----- WebContent/gui/OSRM.RoutingGUI.js | 1 - WebContent/images/config.png | Bin 0 -> 397 bytes WebContent/images/config_active.png | Bin 0 -> 493 bytes WebContent/images/config_hover.png | Bin 0 -> 482 bytes WebContent/images/mapping.png | Bin 0 -> 329 bytes WebContent/images/mapping_active.png | Bin 0 -> 378 bytes WebContent/images/mapping_hover.png | Bin 0 -> 347 bytes WebContent/images/raw/gui.pdf | Bin 3881 -> 5391 bytes WebContent/main.css | 36 +++++++++++++++++- WebContent/main.html | 55 +++++++++++++-------------- WebContent/main.js | 18 ++++++--- 12 files changed, 73 insertions(+), 47 deletions(-) create mode 100644 WebContent/images/config.png create mode 100644 WebContent/images/config_active.png create mode 100644 WebContent/images/config_hover.png create mode 100644 WebContent/images/mapping.png create mode 100644 WebContent/images/mapping_active.png create mode 100644 WebContent/images/mapping_hover.png diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index ab8f81c13..3022d3049 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -52,7 +52,6 @@ setLabels: function() { 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"); - document.getElementById("gui-options-toggle").innerHTML = OSRM.loc("GUI_OPTIONS"); document.getElementById("gui-search-source").innerHTML = OSRM.loc("GUI_SEARCH"); document.getElementById("gui-search-target").innerHTML = OSRM.loc("GUI_SEARCH"); document.getElementById("gui-search-source-label").innerHTML = OSRM.loc("GUI_START")+":"; @@ -68,15 +67,6 @@ clearResults: function() { document.getElementById('information-box-header').innerHTML = ""; }, -// show/hide small options bubble -toggleOptions: function() { - if(document.getElementById('options-box').style.visibility=="visible") { - document.getElementById('options-box').style.visibility="hidden"; - } else { - document.getElementById('options-box').style.visibility="visible"; - } -}, - // reposition and hide zoom controls before main box animation beforeMainTransition: function() { var zoom_controls = OSRM.Browser.getElementsByClassName(document,'leaflet-control-zoom'); diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index 5004c6236..6e46510f3 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -37,7 +37,6 @@ init: function() { document.getElementById("gui-reset").onclick = OSRM.GUI.resetRouting; document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting; - document.getElementById("gui-options-toggle").onclick = OSRM.GUI.toggleOptions; document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM; document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs; document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getZoomRoute; diff --git a/WebContent/images/config.png b/WebContent/images/config.png new file mode 100644 index 0000000000000000000000000000000000000000..ec3af403555ca3dbf15b53d60f94bd8e32a260ef GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|>?NMQuIzVMIYh)6c3p@I1PXB$ zctjR6FmMZjFyp1Wb$@_@Ea{HEjtmSN`?>!lvNA9*%6PgshE&{Y4N~N5b`aQO=38J9 z*Ptx%gF*j*VkIMA`(suh|JVnnCdSsof^rQ<1$-_yDuzdSSuKh!OV2BR?q}owVwYcz zL&3Uxk@z!noR%z literal 0 HcmV?d00001 diff --git a/WebContent/images/config_active.png b/WebContent/images/config_active.png new file mode 100644 index 0000000000000000000000000000000000000000..ec71c797b6198f16e9e9475b4acc9d53d9068156 GIT binary patch literal 493 zcmV4tyLW*KAZ#Xx>iIf4D;yoKEm;DT zJ3nn2L=MQfyLmHE1Sktc5Iu}QTOdMzU}m5J7It=^6p&23az#K{8KePXDO`_=udld~ z5gQ-hv*X8au2}=omU{a(P&J4J@ygeiFCiYivS<;q7hjw`3lYD)aU(>8z?WcP>}8mfnc0PVTIb0@?G#!e(@$KGC(!a_7ZJUek>sg)IkEuy8xge>># z(9~hvf-+a)Yn5i z{qFW{sHY+J++4jH5~f#|ECKot=yhHhnUftI-(J6l`sDa=sHcINfQbSa%@7GLQBk-e zNUQ-#h*=T)_siPbL!AV42_zDL?g0ilJnVt-19S|~wX>9!Ax>q0JNM!K{kT#qP!HT= jEO6UF*5LrqL;(f>KuT8;KfqkQ00000NkvXXu0mjfP;9`A literal 0 HcmV?d00001 diff --git a/WebContent/images/config_hover.png b/WebContent/images/config_hover.png new file mode 100644 index 0000000000000000000000000000000000000000..e90258d46646953d55b93bd2d1c7d1d8405280d9 GIT binary patch literal 482 zcmV<80UiE{P)v>VS;9n?WK#Ss()IVFWn|BJ}4ccH>#tK~g|6;R=I*G9%Ov$a++K8N`ej*!dWq z9cQ??2C6OPHc&N4JCqNUhN$*l#Gn}i6*MknFh9?*$QT+DPz^v95L{aVBE=06sv$tk zkU>2JWY2@05Dkp~x{#zDdqJk6f#)X}mRdpCB3eu+az8&Y5CV+_F%J+Y$p}!@-eykRTAfyA2V5h0?9n&`<*U z9_T-<7zSP$hLar(-(JIfavbJqU_1a51u&W+fJ+pi2oh^R05L0kKZC42*weE1AR{4> zkp74va3fSTkOAZZBN(VnP?0?7|R@Nhqr@%jqX-9QEe06hTn7z@I7pgp(%*!2(q Y0ECy#GbiSN;Q#;t07*qoM6N<$g5STjJpcdz literal 0 HcmV?d00001 diff --git a/WebContent/images/mapping.png b/WebContent/images/mapping.png new file mode 100644 index 0000000000000000000000000000000000000000..50a4b8731de9122f4c1a0308d13c5e2e6d4defdd GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|>?NMQuIzVMIYh)28u!)B1PXB$ zctjR6FmMZjFyp1Wb$@_@Ea{HEjtmSN`?>!lvI6-xJY5_^DsCnJ`Tky>S+jw2=I38u zUmrW>W@)+e-@kwJ?dy}Sf8=M|SN~s6ON&c9JS>c@>(5~Z4qgY*j5Nlt_xIIG?{53` zt7^@+&6_tL{>mUJZJx)HS@H9eYF$55Z}iS0RTpCq=fp(CiHK z_`v8qS%UZ7yLSsJc2s}YoA~bGQo6yLYi`0J`Koh8$2o&=j~HAmi@l%^)WMojyfe9FIq>>+6NJ zw6?{?0UgN#?NMQuIzVMIYguk;}$5W0fjgV zJR*x37`TN%nDNrxx<5ccmUKs7M+SzC{oH>NS%Lglo-U3d6}OWAe19*`tl7ZX`u(rz z;f-!>GmCiAe@p)RcVtzgU?Ot>YrxCx*8|oqFmgU5%9d7k$4uvf;|jK>@8yoa?C%_1 z$oOK?_ZLM9e;tA!R5kSMo_)}d$*Ojhh28w9tHvD}hB@8LR+Ctd*xz(i$Y}WH+|Xcj z!}Izy0ntSc-VSvPYwIKX-1#{{QNZ;>a)`=>5=aQwB3SR1=_;3E%R z5fQ0~+NE!fGjzRNukTp4@aT(&T3;3jo2PWxo^F_Aa)Du!tsm;DkJt{<})nzmn; o&^w>{U@D`f8^bGex1h=94CVJDoyzQ3L4n5L>FVdQ&MBb@0FPROTmS$7 literal 0 HcmV?d00001 diff --git a/WebContent/images/raw/gui.pdf b/WebContent/images/raw/gui.pdf index 497b124c5c4d01b3c0787abac1dcabc8f28525f6..3b299dd8ce6139889d253bbdf3acf91e009b4f3c 100644 GIT binary patch delta 2960 zcmbtWc{mj68qXHSF0#g0jwNQFF*DYY{iJLS6(jq;8?uclOA$sIvX(){QXy0#a;*nB zD7%VlEuBI3LAmPO=RRlq@4o-Mzwh0?_xpX{^L%fGO#0~>Use_jb%sTrN@3+E4;xkA z278X@DpDsv)(d+qhKC1KfUVwibPZQEZY`^YB{Z?na4myNZL=*XS~)f7C;FU)=X1Ng zgq`foXN8*bH+4hV)3qDe_%?kkKH{o94Hr?ajHGatCB=>j&zHAh`x$W52Ucr(Ra@9*LC10z=@k1~>B?i7jM?S&8e8!{VM z7m!2>zx<{0iEq&Z@1%a2(KfU@UmPu*b_)-wyeDEk9`}(Fac~Hd%8}d|y{IwP?%`{A z=jOSjZ>)QAe!g{KY(Z?IFd!5d=;8y^)&@Y#-2*&{UO+gSI?bX$cDK?BVS{lo!T`%6 zk~lqLB2hQq)5XH$xoOsCPPr!^BGhCGIR$XL>~X7WY~qN6<8day*T7_F^su-ykNH-D zaX62~?jG0k_}-+!%lNz^u#grDcfM$;l~LUeuA-AdGG<=rue)i>d*Kc~GVE+!cg^J| zngRn#RX$_E0*CWtE9WUEG!jiat&H4>p1Rc--tP+Ny4y#y(NG)*mAF+2r3AE#yvPhz zRKIcAqt787wNil?OB3}!VYcln6=hfF5k38N@ajF%$dZ=B6s0=lP2(dmnfqSUE*vOV zR54{rO>ET8?NsY}uToa>flHI#mCuguuGl8g`iABR=f{o;)bvMcq1$FVQA}Bh(6lOm zdw^RgF~r^3A9#e0CiD-1?m;V464fM^&Ni~+)78eljOgMfqK1OP-ogm@+} z0%#9|B9452i=g%%mpX~~hbutAzdu7V!3rC~4&!>g1#scCxh6=1V5ZRKSy%g>@=G)K zjZGzGGoonu-jWG+zz9g;wVSPWat&fr6X_AF>Z0m zrqYjKmOM|m3KEgWZ8>UZYT2-hQm1wj;tA6mC5|xAYFOINw5P5nf9Qa+_7p z9f}w*2dQPa!W%%cjWL2uSy{tS<&7R%bN(l%?nCpX)DHhfb9ItdKjix7G!gSRpD@e@ znZB2cjjJyN4*5oP{ZZff7W@n0$lnP^{9lA)Sy8AT51etyK7CF}BzB-07nw&&ViTXP zyq9(Q>9Xx)SxfjHPWaBnc*Y~fYx71Qa6VRP-f?D*4141V z_pFo5E$z0P8SLfkxG|$hokLMg1%c?nUGHsJ|8t|a${J%Eg|W08%im5I2MO*HDYY)t z0Gkp>D;ZWg?CIBXpSHlXUAz5N8IO&#Bci724~;6IZjeuY0H0fw&#J9bDni&f9n6dVcS= zgu}{?_t!-v-0=f=%=^XN*-BQ)a&V-he+qmKMOMEYrZdJ@Td}2XvV2SkVtC8k4&deN z&*N(kcBwOaIE7vc8G1eCvCJ?EUG1HX$eE|v_m;4a6xFI-oC*a5cBEf&l%a(=cbp8f-h-?b$n1O zB7YNIc%Quc#{H$D*_gW(UJSf6SB%mob%K+SHY&sv`m(}%TF;pmUeWY;*#=ZI*!($9 z-|9HS23~*Dpo%s7@Dp^+tC_L@#?G**5s;#OcB3XQDB~D z$K5d!~T#k>HTk-SZZ&j6dvbBcdS<&TjX*k`5it`&({UonU+n5l|hUg~T zHu3ri*ZxJ{Um9;4O@wE=gx)tI*cvAhRGoyPBZY#UYzIAY$B=Oa37MVEu`^TD~{636>j zxe7O$sHJ=b8ab2-I`grpl}LGs+Rtr5^};bVDl*Ag_H@iHrDoZcxpnbDmMRBdeL#k! z1oeyhRc|>Xe_qoV(%nicC(0UGszD@m9Y+m0Go~Eif$xq5=w8f$ZYn#4*TzY6hbi7@ z^N3Mi&y#XQC7PIG-XNTM5~4SHmI>*%;qMu~_8JhsQNtzttf{C@*QiCcLa=tYq?RCr zJ|yz%ua!9Eu%;Et@Mye)z_a3#At^^jzgR3DO=RBtI^+XqJsIZD%1vHZF0wQ+&^8cB z8Z7HFPeXK%&KBK&mm8Q@$+pwkMau2?x;q8Ylfn?fX0}b<-mAh|7J`PCxHCyX?~r)T z0DF-z$Ke~@RYunx6duhj8jnR~79C37*ADZl?f@q~Y)b>bLOmw;XZ(U5Ox1PHYZOCiY!sxrYUp!pbOs=@0gtm!5Ol+a;Dttm8 zbYB?|!|?^o%+joR-k0S^3Di=$v%KB;Hzw0He?O)+o?ZFYt_==v?DHN8`XzD(s2 zw#&xp8LjP|89S6Nb4zNGOTFjxp7(t}pL3pnp6B;{e!tJ>d8oP%Aq^2ylEwwn2WeC( zIdbfd$9V>!6Soi1`1)RNHWVGcZ_$7p>KdeD*JIn2qHf8U^fHH){9SrsL2X^im^P)8 zn=knbMb@+1@UA6Kr>Y!;Q^Ok;kn^H0$HV?{C~R3h{oNzJ{-o>;Ci>CBET>ZcTDY%< zgSOy#SK3)L>oaJ~^mSfO*GYzd-nAwY7njG=3Cx`$m9=(zjGqy9q?O{D7{y4QY{=2} zE90HK#9Uuj362@i;kbUd?Y7jfmP5$0R?^-*F~#au*O`TLY1O4cfKI29^u z*+eho*a_o%`hwp|TWb?SdG%8id~Q@!XIXOZvCK5>?0%>VY_Y=b;shQ2Ztu_**|u(j zp`+_^jL@m_a01u<2>a~#%4yds5LE`o^Wn~lXvNlfBx)^=a`hiO7d!K2rXXeS#Mha zx1f-FdN7sK5YEkcpwg)>KH@~?OTv;VpxevGk14knw{iU$`2O0>53DzpMXjT3!OedO zT`pO=MUR6M=4Oh4@E%ipKx@}cQDNNmyElpOyTT%zk8g|$^_vd9Yp^7&8D(?xs!3-4 ze`Igd?^2ac5R0AXt`4tV_VhoE)p$bHts%odE!!n7n4a~jB1h=d&i5@PT8GPxIX`hl zj)Dwu_a0)L^-z9oEWvHjjC9nA$1yLLrdE%}ZF+$x-+I*cekD(8g0-Z7Jsvi!$u&7$c2_hx>lcU*A!u?%a-2n20e@8%2$J6$_bHtkuY+2yu!*YOK!cT`gOY;wtAWW9+uD`ugm`x!?(^6+_=|&Fb>BaO;EY)t9~G^pik?I z$gu+OG!+eyDp#CyK&w)jI0GB0jSTgcdCH}?FnAmJnP7~Ymi*Jv{clqCjckGHq?0n0 z*8`Xp2YsWFGk&Gn=hL_7)x*9WZnU>ot{Xn@e?BA^TOvVy*tjaBXuFC z=S~a`fB2{wiN)A@^0bT`UK|23!!oIgJ7Mc&c!|!@mo3%q;yK#af2vy$120b9a+#v` zY_C2|d1)^lMMh1F@&RJLUD91!e$MMZEN2ePdvP)bu=i{YWa_4;M4nXSYEQ;dcatTR zX@t4%lxU$9vw7=ASi2;A>x=F!WpgzZ3bWU>u4U@;FFH0SvCD-kk&`@ZV~%2SHhIrw z?to?ov^}-Fu4h)(FLA!2T?SmOZ`$0j)K8MgCCco1k{;F5DHkBEA!qaCj&6yGKt^E}E?2w{)$}>az`oTPEeiQz3+hYFONcw6ein`*Fb{18B?r2CP;pR1Ueo>R84sLnSz< z97oU_(eR=l5qlyT!yM{Cf~^tDGnZ?os?c~Uoz4tBb|S}qQO(k+T$Syg^yu2@lKaVp zU01dpJH+1?fNc#DcZW9;44(h2dBYWSUfeUN{atPE(CYqFM#9057)o>D+v>uH#Ae5g z>CMVzwt#QLZlS}0Av8H9Lp3DO&^0_b26_f+4mE;$K@mnjS^!PBQ;kMaI<6Q1wYCOY zTSG&lf(bug03wjIC8cnhg|ZCh|1dr}1P?TVB8-7X|10Q^35tjQ$q;6ys6ScMf0;27 zWkP$Pe8t1~uNwry{O=6)cV=viK>Rgpj6%@5K^iDyprIFm5DWdo0rdhJx
-
-
+ +
+
-Config block + +
Configuraion
+
+
Language:
German
+
Units:
Miles
+
+
-
-
+ +
+
-Mapping block + +
Mapping Tools
+
+
+ +Highlight unnamed streets +
+
- +
+
+ +
@@ -134,27 +154,6 @@ Mapping block
- -
- - -
- - - Mapping Tools - - -
-
- - Highlight unnamed streets -
-
- JOSM - OSM Bugs -
-
-
diff --git a/WebContent/main.js b/WebContent/main.js index fb633c62a..7cd8c3029 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -59,6 +59,12 @@ OSRM.prefetchImages = function() { {id:'restore', url:'images/restore.png'}, {id:'restore_active', url:'images/restore_active.png'}, {id:'restore_hover', url:'images/restore_hover.png'}, + {id:'config', url:'images/config.png'}, + {id:'config_active', url:'images/config_active.png'}, + {id:'config_hover', url:'images/config_hover.png'}, + {id:'mapping', url:'images/mapping.png'}, + {id:'mapping_active', url:'images/mapping_active.png'}, + {id:'mapping_hover', url:'images/mapping_hover.png'}, {id:'printer', url:'images/printer.png'}, {id:'printer_active', url:'images/printer_active.png'}, {id:'printer_hover', url:'images/printer_hover.png'}, @@ -129,13 +135,13 @@ OSRM.prefetchCSSIcons = function() { { id:'#input-mask-header', image_id:'osrm-logo'}, { id:'.styled-select', image_id:'selector'}, - { id:'#config-handle-icon', image_id:'cancel'}, - { id:'#config-handle-icon:hover', image_id:'cancel_hover'}, - { id:'#config-handle-icon:active', image_id:'cancel_active'}, + { id:'#config-handle-icon', image_id:'config'}, + { id:'#config-handle-icon:hover', image_id:'config_hover'}, + { id:'#config-handle-icon:active', image_id:'config_active'}, - { id:'#mapping-handle-icon', image_id:'cancel'}, - { id:'#mapping-handle-icon:hover', image_id:'cancel_hover'}, - { id:'#mapping-handle-icon:active', image_id:'cancel_active'}, + { id:'#mapping-handle-icon', image_id:'mapping'}, + { id:'#mapping-handle-icon:hover', image_id:'mapping_hover'}, + { id:'#mapping-handle-icon:active', image_id:'mapping_active'}, { id:'#main-handle-icon', image_id:'restore'}, { id:'#main-handle-icon:hover', image_id:'restore_hover'}, From 7830f82b62aef73147496ec91df5f422e52f7c4a Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 9 May 2012 15:21:11 +0100 Subject: [PATCH 25/72] added language support for new elements --- WebContent/gui/OSRM.MainGUI.js | 4 +++ WebContent/localization/OSRM.Locale.da.js | 22 ++++++++++++----- WebContent/localization/OSRM.Locale.de.js | 18 +++++++++++--- WebContent/localization/OSRM.Locale.en.js | 26 ++++++++++++++------ WebContent/localization/OSRM.Locale.fi.js | 22 ++++++++++++----- WebContent/localization/OSRM.Locale.fr.js | 18 +++++++++++--- WebContent/localization/OSRM.Locale.pl.js | 22 ++++++++++++----- WebContent/localization/OSRM.Localization.js | 2 +- WebContent/main.html | 12 ++++++--- 9 files changed, 107 insertions(+), 39 deletions(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 3022d3049..0a95c4ded 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -59,6 +59,10 @@ setLabels: function() { document.getElementById("gui-input-source").title = OSRM.loc("GUI_START_TOOLTIP"); document.getElementById("gui-input-target").title = OSRM.loc("GUI_END_TOOLTIP"); document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); + document.getElementById("gui-mapping-label").innerHTML = OSRM.loc("GUI_MAPPING_TOOLS"); + document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION"); + document.getElementById("gui-language-label").innerHTML = OSRM.loc("GUI_LANGUAGE"); + document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS"); }, // clear output area diff --git a/WebContent/localization/OSRM.Locale.da.js b/WebContent/localization/OSRM.Locale.da.js index 4725d1f01..bec6ddf7e 100644 --- a/WebContent/localization/OSRM.Locale.da.js +++ b/WebContent/localization/OSRM.Locale.da.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["da"] = { +// own language +"LANGUAGE": "Dansk", //gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "OSM Fejl", "GUI_START": "Start", "GUI_END": "Destination", -"GUI_RESET": "  Nulstil  ", -"GUI_SEARCH": "  Vis  ", +"GUI_RESET": "Nulstil", +"GUI_SEARCH": "Vis", "GUI_REVERSE": "Omvendt", -"GUI_OPTIONS": "Kortlægnings værktøjer", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje", "GUI_START_TOOLTIP": "Indtast start", "GUI_END_TOOLTIP": "Indtast destination", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting af KIT - Geocoder af OSM", +//config +"GUI_CONFIGURATION": "Konfiguration", +"GUI_LANGUAGE": "Sprog", +"GUI_UNITS": "Enheder", +"GUI_KILOMETERS": "Kilometer", +"GUI_MILES": "Miles", +// mapping +"GUI_MAPPING_TOOLS": "Kortlægnings værktøjer", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje", +"GUI_SHOW_PREVIOUS_ROUTES": "Vis tidligere ruter", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Søgeresultater", "FOUND_X_RESULTS": "fandt %i resultater", diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js index b1dde0154..bd28ef88d 100644 --- a/WebContent/localization/OSRM.Locale.de.js +++ b/WebContent/localization/OSRM.Locale.de.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["de"] = { +// own language +"LANGUAGE": "Deutsch", //gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "OSM Bugs", "GUI_START": "Start", "GUI_END": "Ziel", "GUI_RESET": "Reset", "GUI_SEARCH": "Zeigen", "GUI_REVERSE": "Umdrehen", -"GUI_OPTIONS": "Kartenwerkzeuge", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben", "GUI_START_TOOLTIP": "Startposition eingeben", "GUI_END_TOOLTIP": "Zielposition eingeben", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +//config +"GUI_CONFIGURATION": "Einstellungen", +"GUI_LANGUAGE": "Sprache", +"GUI_UNITS": "Einheiten", +"GUI_KILOMETERS": "Kilometer", +"GUI_MILES": "Meilen", +// mapping +"GUI_MAPPING_TOOLS": "Kartenwerkzeuge", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben", +"GUI_SHOW_PREVIOUS_ROUTES": "Frühere Routen zeigen", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Suchergebnisse", "FOUND_X_RESULTS": "%i Ergebnisse gefunden", diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js index 8f20a94ef..db52d28a8 100644 --- a/WebContent/localization/OSRM.Locale.en.js +++ b/WebContent/localization/OSRM.Locale.en.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["en"] = { -//gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "OSM Bugs", +// own language +"LANGUAGE": "English", +// gui "GUI_START": "Start", "GUI_END": "End", "GUI_RESET": "  Reset  ", "GUI_SEARCH": "  Show  ", "GUI_REVERSE": "Reverse", -"GUI_OPTIONS": "Mapping Tools", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", "GUI_START_TOOLTIP": "Enter start", "GUI_END_TOOLTIP": "Enter destination", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +// config +"GUI_CONFIGURATION": "Configuration", +"GUI_LANGUAGE": "Language", +"GUI_UNITS": "Units", +"GUI_KILOMETERS": "Kilometers", +"GUI_MILES": "Miles", +// mapping +"GUI_MAPPING_TOOLS": "Mapping Tools", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", +"GUI_SHOW_PREVIOUS_ROUTES": "Show previous routes", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Search Results", "FOUND_X_RESULTS": "found %i results", @@ -40,7 +50,7 @@ OSRM.Localization["en"] = { "NO_RESULTS_FOUND": "No results found", "NO_RESULTS_FOUND_SOURCE": "No results found for start", "NO_RESULTS_FOUND_TARGET": "No results found for end", -//routing +// routing "ROUTE_DESCRIPTION": "Route Description", "GET_LINK_TO_ROUTE": "Generate Link", "GENERATE_LINK_TO_ROUTE": "waiting for link", @@ -50,7 +60,7 @@ OSRM.Localization["en"] = { "DURATION": "Duration", "YOUR_ROUTE_IS_BEING_COMPUTED": "Your route is being computed", "NO_ROUTE_FOUND": "No route possible", -//printing +// printing "OVERVIEW_MAP": "Overview Map", "NO_ROUTE_SELECTED": "No route selected", // directions @@ -89,6 +99,6 @@ OSRM.Localization["en"] = { "DIRECTION_15":"You have reached your destination" }; -//set GUI language on load +// set GUI language on load if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true ) OSRM.Localization.setLanguage("en"); diff --git a/WebContent/localization/OSRM.Locale.fi.js b/WebContent/localization/OSRM.Locale.fi.js index ab63bc61f..37df99c93 100644 --- a/WebContent/localization/OSRM.Locale.fi.js +++ b/WebContent/localization/OSRM.Locale.fi.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["fi"] = { +// own language +"LANGUAGE": "Suomi", //gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "OSM Bugs", "GUI_START": "Lähtöpaikka", "GUI_END": "Määränpää", -"GUI_RESET": "  Tyhjennä  ", -"GUI_SEARCH": "  Etsi  ", +"GUI_RESET": "Tyhjennä", +"GUI_SEARCH": "Etsi", "GUI_REVERSE": "Käänteinen reitti", -"GUI_OPTIONS": "Kartoitustyökalut", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet", "GUI_START_TOOLTIP": "Syötä lähtöpaikka", "GUI_END_TOOLTIP": "Syötä määränpää", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +//config +"GUI_CONFIGURATION": "Kokoonpano", +"GUI_LANGUAGE": "Kieli", +"GUI_UNITS": "Yksiköt", +"GUI_KILOMETERS": "Kilometri", +"GUI_MILES": "Miles", +// mapping +"GUI_MAPPING_TOOLS": "Kartoitustyökalut", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet", +"GUI_SHOW_PREVIOUS_ROUTES": "Näytä edelliset reitit", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Haun tulokset", "FOUND_X_RESULTS": "Löytyi %i vaihtoehtoa", diff --git a/WebContent/localization/OSRM.Locale.fr.js b/WebContent/localization/OSRM.Locale.fr.js index ff4d04bea..49c8931ac 100644 --- a/WebContent/localization/OSRM.Locale.fr.js +++ b/WebContent/localization/OSRM.Locale.fr.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["fr"] = { +// own language +"LANGUAGE": "Français", //gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "Bugs OSM", "GUI_START": "Départ", "GUI_END": "Arrivée", "GUI_RESET": "Réinitialiser", "GUI_SEARCH": "Montrer", "GUI_REVERSE": "Inverser", -"GUI_OPTIONS": "Outils de cartographie", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom", "GUI_START_TOOLTIP": "Entrez le lieu de départ", "GUI_END_TOOLTIP": "Entrez le lieu d’arrivée", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - hébergement par KIT - géocodage par OSM", +//config +"GUI_CONFIGURATION": "Configuration", +"GUI_LANGUAGE": "Langue", +"GUI_UNITS": "Unités", +"GUI_KILOMETERS": "Kilomètres", +"GUI_MILES": "Miles", +// mapping +"GUI_MAPPING_TOOLS": "Outils de cartographie", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom", +"GUI_SHOW_PREVIOUS_ROUTES": "Afficher itinéraires précédents", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Résultats de recherche", "FOUND_X_RESULTS": "%i résultat(s)", diff --git a/WebContent/localization/OSRM.Locale.pl.js b/WebContent/localization/OSRM.Locale.pl.js index 0cb435122..abcb6ac56 100644 --- a/WebContent/localization/OSRM.Locale.pl.js +++ b/WebContent/localization/OSRM.Locale.pl.js @@ -20,19 +20,29 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization["pl"] = { +// own language +"LANGUAGE": "Polski", //gui -"OPEN_JOSM": "JOSM", -"OPEN_OSMBUGS": "OSM Bugs", "GUI_START": "PoczÄ…tek", "GUI_END": "Koniec", -"GUI_RESET": "  Reset  ", -"GUI_SEARCH": "  Pokaż  ", +"GUI_RESET": "Reset", +"GUI_SEARCH": "Pokaż", "GUI_REVERSE": "Odwróć", -"GUI_OPTIONS": "NarzÄ™dzia", -"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy", "GUI_START_TOOLTIP": "Wprowadź poczÄ…tek", "GUI_END_TOOLTIP": "Wprowadź koniec", "GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting: KIT - Geocoder: OSM", +//config +"GUI_CONFIGURATION": "Konfiguracja", +"GUI_LANGUAGE": "JÄ™zyk", +"GUI_UNITS": "Jednostki", +"GUI_KILOMETERS": "Kilometrów", +"GUI_MILES": "Miles", +// mapping +"GUI_MAPPING_TOOLS": "NarzÄ™dzia mapowania", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy", +"GUI_SHOW_PREVIOUS_ROUTES": "Pokaż poprzednie trasy", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", // geocoder "SEARCH_RESULTS": "Wyniki wyszukiwania", "FOUND_X_RESULTS": "znaleziono %i wyników", diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 4cf346dda..1b71f6143 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -39,7 +39,7 @@ init: function() { var supported_languages = OSRM.DEFAULTS.LANGUAGE_SUPPORTED; for(var i=0, size=supported_languages.length; i
-
Configuraion
+
Configuraion
-
Language:
German
-
Units:
Miles
+
+
Language:
+
x
+
+
Units:
+
x
@@ -102,7 +106,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
Mapping Tools
+
Mapping Tools
From 3e15c0a164f017dbc54155d6450c68bb8a4b076b Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 9 May 2012 16:22:18 +0100 Subject: [PATCH 26/72] tests with showing routing history --- WebContent/base/OSRM.Routes.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 02e75f2fb..8c665f815 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -45,6 +45,7 @@ OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { +// if( document.getElementById('option-show-previous-routes').checked == true) // if(!this._noroute) { // this._route_history.push( this._current_route ); // if(this._route_history.length==6) { @@ -69,17 +70,20 @@ OSRM.extend( OSRM.Route,{ hideRoute: function() { this._current_route.hide(); this._unnamed_route.hide(); +// this.clearHistoryRoutes(); // activate printing OSRM.Printing.deactivate(); }, hideAll: function() { - this._current_route.hide(); - this._unnamed_route.hide(); + this.hideRoute(); this._old_route.hide(); this._noroute = OSRM.Route.ROUTE; - // activate printing - OSRM.Printing.deactivate(); - }, + }, +// clearHistoryRoutes: function() { +// for(var i=0,size=this._route_history.length; i Date: Wed, 9 May 2012 17:23:11 +0100 Subject: [PATCH 27/72] added code to create selector elements with our look&feel --- WebContent/gui/OSRM.Selector.js | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 WebContent/gui/OSRM.Selector.js diff --git a/WebContent/gui/OSRM.Selector.js b/WebContent/gui/OSRM.Selector.js new file mode 100644 index 000000000..6d545d8c7 --- /dev/null +++ b/WebContent/gui/OSRM.Selector.js @@ -0,0 +1,61 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM selector +// [create special selector elements] + + +OSRM.GUI.extend( { + +// initialize selector with all options and our look&feel +initSelector: function(id, options, selected, onchange_fct) { + // create dropdown menu + var select = document.getElementById(id); + select.className = "styled-select-helper base-font"; + select.onchange = function() { OSRM.GUI.selectorOnChange(this); onchange_fct(this.value); }; + + // fill dropdown menu + for(var i=0, size=options.length; i Date: Wed, 9 May 2012 17:27:11 +0100 Subject: [PATCH 28/72] changes localization to new selector elements, completed units selector, modified localization selector --- WebContent/OSRM.config.js | 12 ++--- WebContent/gui/OSRM.MainGUI.js | 21 ++++++-- WebContent/localization/OSRM.Localization.js | 52 ++++++-------------- WebContent/main.css | 27 ++++++---- WebContent/main.html | 25 +++++++--- WebContent/main.js | 2 +- 6 files changed, 74 insertions(+), 65 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 3e8701590..c72a16618 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -42,12 +42,12 @@ OSRM.DEFAULTS = { LANGUAGE: "en", LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ - {display_name:"en", encoding:"en"}, - {display_name:"da", encoding:"da"}, - {display_name:"de", encoding:"de"}, - {display_name:"fi", encoding:"fi"}, - {display_name:"fr", encoding:"fr"}, - {display_name:"pl", encoding:"pl"} + {encoding:"en", name:"English"}, + {encoding:"da", name:"Dansk"}, + {encoding:"de", name:"Deutsch"}, + {encoding:"fi", name:"Suomi"}, + {encoding:"fr", name:"Français"}, + {encoding:"pl", name:"Polski"} ], TILE_SERVERS: [ diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 0a95c4ded..e2bcb2b18 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -41,8 +41,8 @@ init: function() { document.getElementById('gui-input-source').value = OSRM.DEFAULTS.ONLOAD_SOURCE; document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET; - // set default language - OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); + // init units selector + OSRM.GUI.initSelector( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged ); }, // set language dependent labels @@ -52,6 +52,7 @@ setLabels: function() { 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"); + document.getElementById("gui-option-show-previous-routes-label").innerHTML = OSRM.loc("GUI_SHOW_PREVIOUS_ROUTES"); document.getElementById("gui-search-source").innerHTML = OSRM.loc("GUI_SEARCH"); document.getElementById("gui-search-target").innerHTML = OSRM.loc("GUI_SEARCH"); document.getElementById("gui-search-source-label").innerHTML = OSRM.loc("GUI_START")+":"; @@ -61,8 +62,12 @@ setLabels: function() { document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); document.getElementById("gui-mapping-label").innerHTML = OSRM.loc("GUI_MAPPING_TOOLS"); document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION"); - document.getElementById("gui-language-label").innerHTML = OSRM.loc("GUI_LANGUAGE"); - document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS"); + document.getElementById("gui-language-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":"; + document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":"; + + document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS"); + document.getElementById("gui-units-toggle").getElementsByTagName("option")[1].innerHTML = OSRM.loc("GUI_MILES"); + OSRM.GUI.selectorOnChange( document.getElementById("gui-units-toggle") ); }, // clear output area @@ -85,6 +90,12 @@ afterMainTransition: function() { zoom_controls[0].style.left = ( OSRM.G.main_handle.boxVisible() == true ? (OSRM.G.main_handle.boxWidth()+10) : "30") + "px"; zoom_controls[0].style.visibility="visible"; } +}, + +// toggle distance units +onUnitsChanged: function(value) { + OSRM.Utils.setToHumanDistanceFunction(value); + OSRM.Routing.getRoute(); } -}); +}); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 1b71f6143..f674ac274 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -27,53 +27,31 @@ DIRECTORY: "localization/", // holds currently active language current_language: OSRM.DEFAULTS.LANGUAGE, -// initialize localization +//initialize localization init: function() { - // create dropdown menu - var select = document.createElement('select'); - select.id = "gui-language-toggle"; - select.className = "top-left-button"; - select.onchange = function() { OSRM.Localization.setLanguage(this.value); }; - - // fill dropdown menu + // fill option list and find default entry + var options = []; + var options_2 = []; + var selected = 0; var supported_languages = OSRM.DEFAULTS.LANGUAGE_SUPPORTED; for(var i=0, size=supported_languages.length; i + @@ -84,7 +85,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
+
@@ -92,31 +93,42 @@ or see http://www.gnu.org/licenses/agpl.txt.
Language:
-
x
+
Units:
-
x
+
+
-
+
Mapping Tools
+
- + Highlight unnamed streets
-
+
+
+
+ +Show previous routes +
+
+ +
@@ -128,6 +140,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
+
diff --git a/WebContent/main.js b/WebContent/main.js index 7cd8c3029..129d1de04 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -25,8 +25,8 @@ OSRM.init = function() { OSRM.prefetchIcons(); OSRM.prefetchCSSIcons(); - OSRM.Localization.init(); OSRM.GUI.init(); + OSRM.Localization.init(); OSRM.Map.init(); OSRM.Printing.init(); OSRM.Routing.init(); From a329b1259ed5542b467c3badc8dc37a377f59194 Mon Sep 17 00:00:00 2001 From: shiin Date: Wed, 9 May 2012 22:22:51 +0200 Subject: [PATCH 29/72] finished new gui for language toggle --- WebContent/gui/OSRM.MainGUI.js | 2 +- WebContent/gui/OSRM.Selector.js | 8 +++++++- WebContent/localization/OSRM.Localization.js | 11 +++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index e2bcb2b18..015a9087d 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -42,7 +42,7 @@ init: function() { document.getElementById('gui-input-target').value = OSRM.DEFAULTS.ONLOAD_TARGET; // init units selector - OSRM.GUI.initSelector( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged ); + OSRM.GUI.selectorInit( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged ); }, // set language dependent labels diff --git a/WebContent/gui/OSRM.Selector.js b/WebContent/gui/OSRM.Selector.js index 6d545d8c7..cd593c5ea 100644 --- a/WebContent/gui/OSRM.Selector.js +++ b/WebContent/gui/OSRM.Selector.js @@ -22,7 +22,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.GUI.extend( { // initialize selector with all options and our look&feel -initSelector: function(id, options, selected, onchange_fct) { +selectorInit: function(id, options, selected, onchange_fct) { // create dropdown menu var select = document.getElementById(id); select.className = "styled-select-helper base-font"; @@ -56,6 +56,12 @@ selectorOnChange: function(select) { document.getElementById("styled-select-" + select.id).childNodes[0].nodeValue = option[i].childNodes[0].nodeValue; break; } +}, + +// change selector value +selectorChange: function(select, value) { + select.value = value; + OSRM.GUI.selectorOnChange(select); } }); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index f674ac274..58b878b0f 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -42,14 +42,17 @@ init: function() { } // generate selectors - OSRM.GUI.initSelector("gui-language-toggle", options, selected, OSRM.Localization.setLanguage); - OSRM.GUI.initSelector("gui-language-toggle-2", options_2, selected, OSRM.Localization.setLanguage); + OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguage); + OSRM.GUI.selectorInit("gui-language-toggle-2", options_2, selected, OSRM.Localization.setLanguage); // set default language - OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); + OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); }, setLanguage: function(language) { - // TODO: also change language of other selector + // change value of both language selectors + OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language ); + OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle-2'), language ); + if( OSRM.Localization[language]) { OSRM.Localization.current_language = language; // change gui language From 4d28f022732c85012fe422f7853c1d367abc016d Mon Sep 17 00:00:00 2001 From: shiin Date: Wed, 9 May 2012 22:34:27 +0200 Subject: [PATCH 30/72] route history test 2 --- WebContent/base/OSRM.Routes.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 8c665f815..e95b563c4 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -36,7 +36,7 @@ OSRM.Route = function() { // {dashed:false, color:'#000099', weight:5}, // {dashed:false, color:'#000077', weight:5} // ]; -// this._route_history = []; +// this._route_history = []; this._noroute = OSRM.Route.ROUTE; }; @@ -45,18 +45,20 @@ OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { -// if( document.getElementById('option-show-previous-routes').checked == true) -// if(!this._noroute) { -// this._route_history.push( this._current_route ); -// if(this._route_history.length==6) { -// this._route_history[0].hide(); -// this._route_history.splice(0,1); -// } -// for(var i=0,size=this._route_history.length; i Date: Thu, 10 May 2012 11:01:50 +0100 Subject: [PATCH 31/72] Danish da -> dk --- WebContent/OSRM.config.js | 2 +- .../localization/{OSRM.Locale.da.js => OSRM.Locale.dk.js} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename WebContent/localization/{OSRM.Locale.da.js => OSRM.Locale.dk.js} (95%) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index c72a16618..733615763 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -43,7 +43,7 @@ OSRM.DEFAULTS = { LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ {encoding:"en", name:"English"}, - {encoding:"da", name:"Dansk"}, + {encoding:"dk", name:"Dansk"}, {encoding:"de", name:"Deutsch"}, {encoding:"fi", name:"Suomi"}, {encoding:"fr", name:"Français"}, diff --git a/WebContent/localization/OSRM.Locale.da.js b/WebContent/localization/OSRM.Locale.dk.js similarity index 95% rename from WebContent/localization/OSRM.Locale.da.js rename to WebContent/localization/OSRM.Locale.dk.js index bec6ddf7e..520a44510 100644 --- a/WebContent/localization/OSRM.Locale.da.js +++ b/WebContent/localization/OSRM.Locale.dk.js @@ -19,7 +19,7 @@ or see http://www.gnu.org/licenses/agpl.txt. // [Danish language support] -OSRM.Localization["da"] = { +OSRM.Localization["dk"] = { // own language "LANGUAGE": "Dansk", //gui @@ -101,4 +101,4 @@ OSRM.Localization["da"] = { //set GUI language on load if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true ) - OSRM.Localization.setLanguage("da"); + OSRM.Localization.setLanguage("dk"); \ No newline at end of file From 224c55dec1a711b64f0e4394159ec61c097d7aef Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 10 May 2012 12:26:56 +0100 Subject: [PATCH 32/72] fixed bug that did not always remove drag marker on reset --- WebContent/base/OSRM.Markers.js | 6 +++++- WebContent/gui/OSRM.RoutingGUI.js | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/WebContent/base/OSRM.Markers.js b/WebContent/base/OSRM.Markers.js index 09179abbb..444020107 100644 --- a/WebContent/base/OSRM.Markers.js +++ b/WebContent/base/OSRM.Markers.js @@ -24,12 +24,16 @@ OSRM.Markers = function() { this.dragger = new OSRM.DragMarker("drag", {draggable:true,icon:OSRM.G.icons['marker-drag'],dragicon:OSRM.G.icons['marker-drag']});; }; OSRM.extend( OSRM.Markers,{ -removeAll: function() { +reset: function() { + // remove route markers for(var i=0; i Date: Thu, 10 May 2012 12:52:55 +0100 Subject: [PATCH 33/72] test --- WebContent/base/OSRM.Routes.js | 78 +++++++++++++++++++----------- WebContent/main.css | 16 +++--- WebContent/main.html | 13 ++--- WebContent/routing/OSRM.Routing.js | 10 ++++ 4 files changed, 74 insertions(+), 43 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index e95b563c4..8e603910b 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -30,13 +30,28 @@ OSRM.Route = function() { this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10}; this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10}; -// this._route_history_styles = [{dashed:false, color:'#0033FF', weight:5}, -// {dashed:false, color:'#0011DD', weight:5}, -// {dashed:false, color:'#0000BB', weight:5}, -// {dashed:false, color:'#000099', weight:5}, -// {dashed:false, color:'#000077', weight:5} -// ]; -// this._route_history = []; + this._route_history_styles = [{dashed:false, color:'#FF0000', weight:5}, + {dashed:false, color:'#00FF00', weight:5}, + {dashed:false, color:'#0000FF', weight:5}, + {dashed:false, color:'#FF00FF', weight:5}, + {dashed:false, color:'#00FFFF', weight:5}, + {dashed:false, color:'#770000', weight:5}, + {dashed:false, color:'#007700', weight:5}, + {dashed:false, color:'#000077', weight:5}, + {dashed:false, color:'#770077', weight:5}, + {dashed:false, color:'#007777', weight:5} + ]; + this._route_history = [ new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ), + new OSRM.SimpleRoute("current" , {dashed:false} ) ]; + this._route_history_count = 0; this._noroute = OSRM.Route.ROUTE; }; @@ -45,21 +60,12 @@ OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { -// console.log("show route", this._route_history.length); -// if( document.getElementById('option-show-previous-routes').checked == true) { -// if(!this._noroute && this.isShown()) { -// this._route_history.push( this._current_route ); -// if(this._route_history.length==6) { -// this._route_history[0].hide(); -// this._route_history.splice(0,1); -// } -// for(var i=0,size=this._route_history.length; i0; i--) +// this._route_history[i].setPositions( this._route_history[i-1].getPositions() ); +// this._route_history[0].setPositions( this._current_route.getPositions() ); +// } +// } }, hideRoute: function() { + if( document.getElementById('option-show-previous-routes').checked == true) { + for(var i=0,size=this._route_history.length; i
-
+
Configuraion
-
Language:
-
+
Language:
+
-
Units:
-
+
Units:
+
@@ -106,8 +106,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
+
Mapping Tools
@@ -141,6 +141,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
+
diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 7d4a360cc..f1761989d 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -65,6 +65,16 @@ showRouteSimple: function(response) { } else { OSRM.RoutingGeometry.show(response); OSRM.RoutingDescription.showSimple(response); + + // store history route + var route = OSRM.G.route; + if( document.getElementById('option-show-previous-routes').checked == true) { + if(route._noroute != OSRM.Route.NOROUTE) { + for(var i=route._route_history.length-1; i>0; i--) + route._route_history[i].setPositions( route._route_history[i-1].getPositions() ); + route._route_history[0].setPositions( route._current_route.getPositions() ); + } + } } OSRM.Routing._updateHints(response); From 85ea79701cfd31cea737247dda92b1b71802b96b Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 10 May 2012 14:43:20 +0100 Subject: [PATCH 34/72] work on history routes --- WebContent/base/OSRM.Routes.js | 72 ++++++++++++++---------------- WebContent/routing/OSRM.Routing.js | 12 +---- 2 files changed, 35 insertions(+), 49 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 8e603910b..b3919d518 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -30,6 +30,8 @@ OSRM.Route = function() { this._unnamed_route_style = {dashed:false, color:'#FF00FF', weight:10}; this._old_unnamed_route_style = {dashed:false, color:'#990099', weight:10}; + this._noroute = OSRM.Route.ROUTE; + this._route_history_styles = [{dashed:false, color:'#FF0000', weight:5}, {dashed:false, color:'#00FF00', weight:5}, {dashed:false, color:'#0000FF', weight:5}, @@ -41,31 +43,16 @@ OSRM.Route = function() { {dashed:false, color:'#770077', weight:5}, {dashed:false, color:'#007777', weight:5} ]; - this._route_history = [ new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ), - new OSRM.SimpleRoute("current" , {dashed:false} ) ]; - this._route_history_count = 0; - - this._noroute = OSRM.Route.ROUTE; + this._route_history = []; + for(var i=0, size=this._route_history_styles.length; i0; i--) -// this._route_history[i].setPositions( this._route_history[i-1].getPositions() ); -// this._route_history[0].setPositions( this._current_route.getPositions() ); -// } -// } }, hideRoute: function() { - if( document.getElementById('option-show-previous-routes').checked == true) { - for(var i=0,size=this._route_history.length; i0; i--) + this._route_history[i].setPositions( this._route_history[i-1].getPositions() ); + this._route_history[0].setPositions( this._current_route.getPositions() ); + } + }, + showHistoryRoutes: function() { + if( document.getElementById('option-show-previous-routes').checked == false) + return; + for(var i=1,size=this._route_history.length; i0; i--) - route._route_history[i].setPositions( route._route_history[i-1].getPositions() ); - route._route_history[0].setPositions( route._current_route.getPositions() ); - } - } + OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); @@ -97,6 +88,7 @@ showRoute: function(response) { OSRM.RoutingNoNames.show(response); OSRM.RoutingDescription.show(response); OSRM.Routing._snapRoute(); + OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); }, From f95e515f204d6d33008c217b4a62abdba6839aa6 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 10 May 2012 14:44:20 +0100 Subject: [PATCH 35/72] fixed bug with IE and select elements, made config box nicer --- WebContent/main.css | 39 +++++++++++++++++++++++++-------------- WebContent/main.html | 5 ++--- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/WebContent/main.css b/WebContent/main.css index add3a9166..103368cfb 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -151,19 +151,6 @@ html, body { } -/* general styles for gui box content */ -.label -{ - font-weight:bold; - margin-bottom:10px; -} -.inner-label -{ - padding:0px 20px 0px 5px; -} - - - /* styles for main-input areas */ #input-mask-header { @@ -187,7 +174,7 @@ html, body { /* styles for main-input input-mask-header */ #gui-language-toggle { - position:absolute; + position:relative; } .top-left-button @@ -410,6 +397,30 @@ html, body { } +/* styles for config and mapping boxes */ +#gui-language-toggle-2 +{ + position:relative; +} +#gui-units-toggle +{ + position:relative; +} +.config-select +{ + width:100px; +} +.label +{ + font-weight:bold; + margin-bottom:10px; +} +.inner-label +{ + padding:0px 20px 0px 5px; +} + + /* buttons */ .button { diff --git a/WebContent/main.html b/WebContent/main.html index 65bb780cf..96cdad7f6 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -93,10 +93,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
Language:
-
+
Units:
-
+
@@ -141,7 +141,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
From d4e6ad8a05583164384a3ecccc2234d70a517971 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Thu, 10 May 2012 15:28:18 +0100 Subject: [PATCH 36/72] added funtionality to the show previous routes button --- WebContent/gui/OSRM.RoutingGUI.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index 8a2ca7903..a5161db17 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -39,7 +39,8 @@ init: function() { document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting; document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM; document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs; - document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getZoomRoute; + document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getZoomRoute; + document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes; }, // click: button "reset" @@ -135,6 +136,19 @@ deleteMarker: function(marker_id) { OSRM.G.markers.removeMarker( id ); OSRM.Routing.getRoute(); OSRM.G.markers.highlight.hide(); +}, + +//click: checkbox "show previous routes" +showPreviousRoutes: function(value) { +// if( document.getElementById('option-show-previous-routes').checked == false) { +// document.getElementById('information-box').innerHTML = ""; +// } else { +// document.getElementById('information-box').innerHTML = ""; +// } + if( document.getElementById('option-show-previous-routes').checked == false) + OSRM.G.route.clearHistoryRoutes(); + else + OSRM.G.route.storeHistoryRoute(); } }); From 4a8c2f323c4477b49ba0dc3dffbedf1c02e2d715 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 11 May 2012 08:23:39 +0100 Subject: [PATCH 37/72] removed comments --- WebContent/gui/OSRM.RoutingGUI.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index a5161db17..e17cf9a7e 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -140,11 +140,6 @@ deleteMarker: function(marker_id) { //click: checkbox "show previous routes" showPreviousRoutes: function(value) { -// if( document.getElementById('option-show-previous-routes').checked == false) { -// document.getElementById('information-box').innerHTML = ""; -// } else { -// document.getElementById('information-box').innerHTML = ""; -// } if( document.getElementById('option-show-previous-routes').checked == false) OSRM.G.route.clearHistoryRoutes(); else From c0e86c47c2ca90e54c27ed133e06738baa3f8f60 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 11 May 2012 12:30:00 +0100 Subject: [PATCH 38/72] changed many names for jsonp routing functions --- WebContent/base/OSRM.Map.js | 5 +- WebContent/base/OSRM.Routes.js | 92 +++++++++++++++++++---------- WebContent/base/osrm/OSRM.Marker.js | 2 +- WebContent/gui/OSRM.RoutingGUI.js | 4 +- WebContent/routing/OSRM.Routing.js | 70 +++++++++++++++------- 5 files changed, 117 insertions(+), 56 deletions(-) diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index 78c77ac28..8cdb504d9 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -75,9 +75,10 @@ initPosition: function() { // map event handlers zoomed: function(e) { if(OSRM.G.dragging) - OSRM.Routing.getDragRoute(); + OSRM.Routing.getRoute_Dragging(); else - OSRM.Routing.getZoomRoute(); + OSRM.Routing.getRoute_Redraw(); +// OSRM.Routing.getRoute_History(); }, contextmenu: function(e) {;}, mousemove: function(e) { OSRM.Via.drawDragMarker(e); }, diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index b3919d518..6139263ca 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -18,6 +18,17 @@ or see http://www.gnu.org/licenses/agpl.txt. // OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets) // [this holds the route geometry] +//OSRM.SimplePosition = function(lat, lng, hint) { +// this.lat = lat; +// this.lng = lng; +// this.hint = hint; +//}; +//OSRM.extend( OSRM.SimplePosition,{ +//getLat: function() { return this.lat; }, +//getLng: function() { return this.lng; } +//}); + + OSRM.Route = function() { this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} ); this._old_route = new OSRM.SimpleRoute("old", {dashed:false,color:"#123"} ); @@ -32,20 +43,24 @@ OSRM.Route = function() { this._noroute = OSRM.Route.ROUTE; - this._route_history_styles = [{dashed:false, color:'#FF0000', weight:5}, - {dashed:false, color:'#00FF00', weight:5}, - {dashed:false, color:'#0000FF', weight:5}, - {dashed:false, color:'#FF00FF', weight:5}, - {dashed:false, color:'#00FFFF', weight:5}, - {dashed:false, color:'#770000', weight:5}, - {dashed:false, color:'#007700', weight:5}, - {dashed:false, color:'#000077', weight:5}, - {dashed:false, color:'#770077', weight:5}, - {dashed:false, color:'#007777', weight:5} - ]; - this._route_history = []; - for(var i=0, size=this._route_history_styles.length; i0; i--) - this._route_history[i].setPositions( this._route_history[i-1].getPositions() ); - this._route_history[0].setPositions( this._current_route.getPositions() ); - } +// if( document.getElementById('option-show-previous-routes').checked == false) +// return; +// if(this.isShown() && this.isRoute()) { +// // move route and positions +// for(var i=this._history_routes-1; i>0; i--) { +// this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); +// this._history_data[i] = this._history_data[i-1]; +// } +// // store new route and positions +// this._history_route[0].setPositions( this._current_route.getPositions() ); +// this._history_data[0] = []; +// var markers = OSRM.G.markers.route; +// for(var i=0,size=markers.length; i1) - OSRM.Routing.getDragRoute(); + OSRM.Routing.getRoute_Dragging(); OSRM.Geocoder.updateLocation( this.parent.label ); }, onDragStart: function(e) { diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index e17cf9a7e..e1fa88216 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -39,7 +39,7 @@ init: function() { document.getElementById("gui-reverse").onclick = OSRM.GUI.reverseRouting; document.getElementById("open-josm").onclick = OSRM.GUI.openJOSM; document.getElementById("open-osmbugs").onclick = OSRM.GUI.openOSMBugs; - document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getZoomRoute; + document.getElementById("option-highlight-nonames").onclick = OSRM.Routing.getRoute_Redraw; document.getElementById("option-show-previous-routes").onclick = OSRM.GUI.showPreviousRoutes; }, @@ -67,7 +67,7 @@ reverseRouting: function() { // recompute route if needed if( OSRM.G.route.isShown() ) { OSRM.G.markers.route.reverse(); - OSRM.Routing.getRoute(); // temporary route reversal for query, actual reversal done after receiving response + OSRM.Routing.getRoute_Reversed(); // temporary route reversal for query, actual reversal done after receiving response OSRM.G.markers.route.reverse(); OSRM.G.markers.highlight.hide(); OSRM.RoutingDescription.showSimple( OSRM.G.response ); diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 375b936d2..82550aff3 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -92,7 +92,7 @@ showRoute: function(response) { } OSRM.Routing._updateHints(response); }, -showRouteZooming: function(response) { +showRouteRedraw: function(response) { if(!response) return; @@ -102,6 +102,15 @@ showRouteZooming: function(response) { } OSRM.Routing._updateHints(response); }, +showRouteHistory: function(response, history_id) { + if(!response) + return; + + if(response.status != 207) { + var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5); + OSRM.G.route._history_route[history_id].setPositions(positions); + } +}, @@ -116,33 +125,40 @@ getRoute: function() { return; } OSRM.JSONP.clear('dragging'); - OSRM.JSONP.clear('zooming'); + OSRM.JSONP.clear('redraw'); OSRM.JSONP.clear('route'); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route'); }, -getZoomRoute: function() { +getRoute_Reversed: function() { if( OSRM.G.markers.route.length < 2 ) return; OSRM.JSONP.clear('dragging'); - OSRM.JSONP.clear('zooming'); - OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRouteZooming, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'zooming'); -}, -getDragRoute: function() { - OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRouteSimple, OSRM.Routing.timeoutRouteSimple, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');; -}, -getReverseRoute: function() { - if( OSRM.G.markers.route.length < 2 ) - return; - - OSRM.JSONP.clear('dragging'); - OSRM.JSONP.clear('zooming'); + OSRM.JSONP.clear('redraw'); OSRM.JSONP.clear('route'); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRouteReverse, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route'); }, +getRoute_Redraw: function() { + if( OSRM.G.markers.route.length < 2 ) + return; + + OSRM.JSONP.clear('dragging'); + OSRM.JSONP.clear('redraw'); + OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRouteRedraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw'); +}, +getRoute_History: function() { + for(var i=0; i<10; i++) + if( OSRM.G.route._history_data[i].length > 0 ) { + OSRM.JSONP.clear('history'+i); + OSRM.JSONP.call(OSRM.Routing._buildHistoryCall(i)+'&instructions=false', OSRM.Routing.showRouteHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); + } +}, +getRoute_Dragging: function() { + OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRouteSimple, OSRM.Routing.timeoutRouteSimple, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');; +}, draggingTimeout: function() { OSRM.G.markers.route[OSRM.G.dragid].hint = null; - OSRM.Routing.getDragRoute(); + OSRM.Routing.getRoute_Dragging(); }, _buildCall: function() { @@ -150,10 +166,24 @@ _buildCall: function() { source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp'; if(OSRM.G.markers.checksum) source += '&checksum=' + OSRM.G.markers.checksum; - for(var i=0,size=OSRM.G.markers.route.length; i Date: Fri, 11 May 2012 15:08:04 +0100 Subject: [PATCH 39/72] commented out route history --- WebContent/base/OSRM.Map.js | 2 +- WebContent/base/OSRM.Routes.js | 94 ++++++++++++++++-------------- WebContent/gui/OSRM.RoutingGUI.js | 10 ++-- WebContent/routing/OSRM.Routing.js | 6 +- 4 files changed, 58 insertions(+), 54 deletions(-) diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index 8cdb504d9..22625efd2 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -78,7 +78,7 @@ zoomed: function(e) { OSRM.Routing.getRoute_Dragging(); else OSRM.Routing.getRoute_Redraw(); -// OSRM.Routing.getRoute_History(); +// OSRM.Routing.getRoute_RedrawHistory(); }, contextmenu: function(e) {;}, mousemove: function(e) { OSRM.Via.drawDragMarker(e); }, diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 6139263ca..933fc99ef 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -18,16 +18,6 @@ or see http://www.gnu.org/licenses/agpl.txt. // OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets) // [this holds the route geometry] -//OSRM.SimplePosition = function(lat, lng, hint) { -// this.lat = lat; -// this.lng = lng; -// this.hint = hint; -//}; -//OSRM.extend( OSRM.SimplePosition,{ -//getLat: function() { return this.lat; }, -//getLng: function() { return this.lng; } -//}); - OSRM.Route = function() { this._current_route = new OSRM.SimpleRoute("current" , {dashed:false} ); @@ -67,7 +57,7 @@ OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { - this.showHistoryRoutes(); +// this.showHistoryRoutes(); this._noroute = noroute; this._current_route.setPositions( positions ); if ( this._noroute == OSRM.Route.NOROUTE ) @@ -78,7 +68,8 @@ OSRM.extend( OSRM.Route,{ //this._raiseUnnamedRoute(); }, hideRoute: function() { - this.showHistoryRoutes(); +// this.fetchHistoryRoute(); +// this.showHistoryRoutes(); this._current_route.hide(); this._unnamed_route.hide(); // deactivate printing @@ -88,7 +79,7 @@ OSRM.extend( OSRM.Route,{ this.hideRoute(); this._old_route.hide(); this._noroute = OSRM.Route.ROUTE; - this.clearHistoryRoutes(); +// this.clearHistoryRoutes(); }, showUnnamedRoute: function(positions) { @@ -145,41 +136,54 @@ OSRM.extend( OSRM.Route,{ // history route handling storeHistoryRoute: function() { -// if( document.getElementById('option-show-previous-routes').checked == false) -// return; -// if(this.isShown() && this.isRoute()) { -// // move route and positions -// for(var i=this._history_routes-1; i>0; i--) { -// this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); -// this._history_data[i] = this._history_data[i-1]; -// } -// // store new route and positions -// this._history_route[0].setPositions( this._current_route.getPositions() ); -// this._history_data[0] = []; -// var markers = OSRM.G.markers.route; -// for(var i=0,size=markers.length; i0; i--) { + this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); + this._history_data[i] = this._history_data[i-1]; + } + // reset staging spot + this._history_route[0].setPositions( [] ); + this._history_data[0] = []; } }); diff --git a/WebContent/gui/OSRM.RoutingGUI.js b/WebContent/gui/OSRM.RoutingGUI.js index e1fa88216..13a1d34e1 100644 --- a/WebContent/gui/OSRM.RoutingGUI.js +++ b/WebContent/gui/OSRM.RoutingGUI.js @@ -80,7 +80,7 @@ reverseRouting: function() { // click: button "show" showMarker: function(marker_id) { - if( OSRM.JSONP.fences["geocoder_source"] || OSRM.JSONP.fences["geocoder_target"] ) + if( OSRM.JSONP.fences["geocoder_source"] || OSRM.JSONP.fences["geocoder_target"] ) // needed when focus was on input box and user clicked on button return; if( marker_id == OSRM.C.SOURCE_LABEL && OSRM.G.markers.hasSource() ) @@ -140,10 +140,10 @@ deleteMarker: function(marker_id) { //click: checkbox "show previous routes" showPreviousRoutes: function(value) { - if( document.getElementById('option-show-previous-routes').checked == false) - OSRM.G.route.clearHistoryRoutes(); - else - OSRM.G.route.storeHistoryRoute(); +// if( document.getElementById('option-show-previous-routes').checked == false) +// OSRM.G.route.clearHistoryRoutes(); +// else +// OSRM.G.route.storeHistoryRoute(); } }); diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 82550aff3..cee67dc5c 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -65,7 +65,7 @@ showRouteSimple: function(response) { } else { OSRM.RoutingGeometry.show(response); OSRM.RoutingDescription.showSimple(response); - OSRM.G.route.storeHistoryRoute(); +// OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); @@ -88,7 +88,7 @@ showRoute: function(response) { OSRM.RoutingNoNames.show(response); OSRM.RoutingDescription.show(response); OSRM.Routing._snapRoute(); - OSRM.G.route.storeHistoryRoute(); +// OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); }, @@ -146,7 +146,7 @@ getRoute_Redraw: function() { OSRM.JSONP.clear('redraw'); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRouteRedraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw'); }, -getRoute_History: function() { +getRoute_RedrawHistory: function() { for(var i=0; i<10; i++) if( OSRM.G.route._history_data[i].length > 0 ) { OSRM.JSONP.clear('history'+i); From 14ca66459ad3de8098a648047ee3db6f5c42cd4e Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Fri, 11 May 2012 16:25:06 +0100 Subject: [PATCH 40/72] history routes work now (i hope) --- WebContent/base/OSRM.Routes.js | 27 ++++++++++++++++++++------- WebContent/gui/OSRM.RoutingGUI.js | 8 ++++---- WebContent/routing/OSRM.Routing.js | 4 ++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/WebContent/base/OSRM.Routes.js b/WebContent/base/OSRM.Routes.js index 933fc99ef..decd60d24 100644 --- a/WebContent/base/OSRM.Routes.js +++ b/WebContent/base/OSRM.Routes.js @@ -57,7 +57,9 @@ OSRM.Route.ROUTE = false; OSRM.extend( OSRM.Route,{ showRoute: function(positions, noroute) { -// this.showHistoryRoutes(); + this.fetchHistoryRoute(); + this.showHistoryRoutes(); + this._noroute = noroute; this._current_route.setPositions( positions ); if ( this._noroute == OSRM.Route.NOROUTE ) @@ -68,10 +70,11 @@ OSRM.extend( OSRM.Route,{ //this._raiseUnnamedRoute(); }, hideRoute: function() { -// this.fetchHistoryRoute(); -// this.showHistoryRoutes(); this._current_route.hide(); this._unnamed_route.hide(); + + this.fetchHistoryRoute(); + this.showHistoryRoutes(); // deactivate printing OSRM.Printing.deactivate(); }, @@ -79,7 +82,7 @@ OSRM.extend( OSRM.Route,{ this.hideRoute(); this._old_route.hide(); this._noroute = OSRM.Route.ROUTE; -// this.clearHistoryRoutes(); + this.clearHistoryRoutes(); }, showUnnamedRoute: function(positions) { @@ -138,9 +141,8 @@ OSRM.extend( OSRM.Route,{ storeHistoryRoute: function() { if( document.getElementById('option-show-previous-routes').checked == false) return; - console.log("store"); - this.fetchHistoryRoute(); if(this.isShown() && this.isRoute()) { + console.log("store"); // store new route and positions in staging spot this._history_route[0].setPositions( this._current_route.getPositions() ); this._history_data[0] = []; @@ -176,6 +178,8 @@ OSRM.extend( OSRM.Route,{ return; if( this._history_data[0].length == 0) return; + if( this._equalRoute() ) + return; console.log("fetch"); // move route and positions for(var i=this._history_routes-1; i>0; i--) { @@ -185,5 +189,14 @@ OSRM.extend( OSRM.Route,{ // reset staging spot this._history_route[0].setPositions( [] ); this._history_data[0] = []; - } + }, + _equalRoute: function() { + var lhs = OSRM.G.markers.route; + var rhs = this._history_data[0]; + for(var i=0,size=Math.min(rhs.length,lhs.length); i Date: Sat, 12 May 2012 08:22:21 +0200 Subject: [PATCH 41/72] made html + css look better --- WebContent/gui/OSRM.MainGUI.js | 2 +- WebContent/gui/OSRM.Selector.js | 4 +- WebContent/localization/OSRM.Localization.js | 4 +- WebContent/main.css | 267 +++++++++++-------- WebContent/main.html | 69 +++-- WebContent/printing/printing.css | 5 +- 6 files changed, 187 insertions(+), 164 deletions(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 015a9087d..cca1eccd4 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -62,7 +62,7 @@ setLabels: function() { document.getElementById("legal-notice").innerHTML = OSRM.loc("GUI_LEGAL_NOTICE"); document.getElementById("gui-mapping-label").innerHTML = OSRM.loc("GUI_MAPPING_TOOLS"); document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION"); - document.getElementById("gui-language-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":"; + document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":"; document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":"; document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS"); diff --git a/WebContent/gui/OSRM.Selector.js b/WebContent/gui/OSRM.Selector.js index cd593c5ea..a9700f50a 100644 --- a/WebContent/gui/OSRM.Selector.js +++ b/WebContent/gui/OSRM.Selector.js @@ -25,7 +25,7 @@ OSRM.GUI.extend( { selectorInit: function(id, options, selected, onchange_fct) { // create dropdown menu var select = document.getElementById(id); - select.className = "styled-select-helper base-font"; + select.className += " styled-select-helper base-font"; select.onchange = function() { OSRM.GUI.selectorOnChange(this); onchange_fct(this.value); }; // fill dropdown menu @@ -44,7 +44,7 @@ selectorInit: function(id, options, selected, onchange_fct) { myspan.id = "styled-select-" + select.id; myspan.appendChild(textnode); select.parentNode.insertBefore(myspan, select); - myspan.style.width = (select.clientWidth)+"px"; + myspan.style.width = (select.clientWidth-2)+"px"; myspan.style.height = (select.clientHeight)+"px"; }, diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 58b878b0f..f65ce350a 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -43,7 +43,7 @@ init: function() { // generate selectors OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguage); - OSRM.GUI.selectorInit("gui-language-toggle-2", options_2, selected, OSRM.Localization.setLanguage); + OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguage); // set default language OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE ); @@ -51,7 +51,7 @@ init: function() { setLanguage: function(language) { // change value of both language selectors OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language ); - OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle-2'), language ); + OSRM.GUI.selectorChange( document.getElementById('gui-language-2-toggle'), language ); if( OSRM.Localization[language]) { OSRM.Localization.current_language = language; diff --git a/WebContent/main.css b/WebContent/main.css index 103368cfb..efe027180 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -17,6 +17,7 @@ or see http://www.gnu.org/licenses/agpl.txt. /* OSRM CSS styles */ +/* ------------------------------------------------------------------------ */ /* fullscreen map */ html, body { @@ -30,6 +31,7 @@ html, body { z-index: 0; } +/* ------------------------------------------------------------------------ */ /* general styles for gui boxes */ .box-wrapper @@ -106,7 +108,21 @@ html, body { } -/* styles for specific gui boxes */ +/* general styles for gui box headers */ +.top-left-button +{ + float:left; + vertical-align:top; +} +.top-right-button +{ + float:right; + vertical-align:top; +} + +/* ------------------------------------------------------------------------ */ + +/* styles for main gui boxes */ #main-wrapper { width:410px; @@ -125,30 +141,6 @@ html, body { top:160px; /* main-input.height+2*gui-box.margin+2*gui-box.padding */ bottom:0px; } -#mapping-wrapper -{ - width:410px; - height:100px; - bottom:25px; - right:5px; -} -#mapping-content -{ - width:390px; - height:80px; -} -#config-wrapper -{ - width:410px; - height:100px; - bottom:25px; - right:5px; -} -#config-content -{ - width:390px; - height:80px; -} /* styles for main-input areas */ @@ -174,16 +166,7 @@ html, body { /* styles for main-input input-mask-header */ #gui-language-toggle { - position:relative; -} - -.top-left-button -{ - float:left; -} -.top-right-button -{ - float:right; + position:absolute; } @@ -251,29 +234,7 @@ html, body { } -/* workaround for invisible scrollbars in Chrome */ -#information-box::-webkit-scrollbar { - height: 10px; - width: 10px; -} -#information-box::-webkit-scrollbar-track { - background: #FFFFFF; -} -#information-box::-webkit-scrollbar-thumb { - min-height: 30px; - background: #EEEEEE; - border: 1px solid #999999; - -webkit-border-radius: 5ex; -} -#information-box::-webkit-scrollbar-thumb:hover { - background: #F9F9F9; -} -#information-box::-webkit-scrollbar-thumb:active { - background: #F4F4F4; -} - - -/* styles for information-box-header */ +/* styles for main-output information-box-header */ .header-title { font-weight:bold; @@ -300,7 +261,29 @@ html, body { } -/* style for information-box table (general) */ +/* styles for main-output information-box -> workaround for invisible scrollbars in Chrome */ +#information-box::-webkit-scrollbar { + height: 10px; + width: 10px; +} +#information-box::-webkit-scrollbar-track { + background: #FFFFFF; +} +#information-box::-webkit-scrollbar-thumb { + min-height: 30px; + background: #EEEEEE; + border: 1px solid #999999; + -webkit-border-radius: 5ex; +} +#information-box::-webkit-scrollbar-thumb:hover { + background: #F9F9F9; +} +#information-box::-webkit-scrollbar-thumb:active { + background: #F4F4F4; +} + + +/* style for main-output information-box -> table (general) */ .no-results { text-align:center; @@ -308,7 +291,7 @@ html, body { } -/* style for information-box table (search results) */ +/* style for main-output information-box -> table (search results) */ .results { border-spacing:0px; @@ -347,7 +330,7 @@ html, body { } -/* style for information-box table (driving directions) */ +/* style for main-output information-box -> table (driving directions) */ .description { border-spacing:0px; @@ -396,9 +379,37 @@ html, body { color:#ff0000 } +/* ------------------------------------------------------------------------ */ -/* styles for config and mapping boxes */ -#gui-language-toggle-2 +/* styles for other gui boxes */ +#mapping-wrapper +{ + width:410px; + height:100px; + bottom:25px; + right:5px; +} +#mapping-content +{ + width:390px; + height:80px; +} +#config-wrapper +{ + width:410px; + height:100px; + bottom:25px; + right:5px; +} +#config-content +{ + width:390px; + height:80px; +} + + +/* styles for content of other gui boxes */ +#gui-language-2-toggle { position:relative; } @@ -406,21 +417,31 @@ html, body { { position:relative; } -.config-select -{ - width:100px; -} -.label +.box-label { font-weight:bold; margin-bottom:10px; } -.inner-label +.config-label { - padding:0px 20px 0px 5px; + margin: 0px 0px 0px 5px; +} +.config-select +{ + width:100px; +} +.mapping-checkbox +{ + margin: 0px 5px 3px 5px; +} +.mapping-button +{ + float: right; } +/* ------------------------------------------------------------------------ */ + /* buttons */ .button { @@ -465,30 +486,39 @@ html, body { } -/* fonts */ -.base-font { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: normal; +/* styled select */ +.styled-select-helper +{ + border: 0px; + text-decoration:none; + opacity: 0; + filter: alpha(opacity=0); + z-index: 5; + cursor:pointer; } -.big-font { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: bold; -} -.medium-font { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10.5px; - font-weight: normal; -} -.small-font { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 9px; - font-weight: normal; +.styled-select +{ + position:absolute; + background-repeat:no-repeat; + background-position: top right; + padding: 1px 1px 1px 1px; + overflow: hidden; } -/* utility styles (defined above buttons, so that buttons retain cursor:pointer)*/ +/* checkboxes */ +input[type=checkbox], +{ + cursor:pointer; +} +.checkbox-label +{ + vertical-align:2px; +} + +/* ------------------------------------------------------------------------ */ + +/* utility styles */ .quad { min-width:10px; @@ -512,34 +542,7 @@ html, body { user-select: text; } -.checkbox-label -{ - vertical-align:2px; -} - -.styled-select-helper -{ - border: 0px; - text-decoration:none; - opacity: 0; - filter: alpha(opacity=0); - z-index: 5; -} -.styled-select -{ - position:absolute; - background-repeat:no-repeat; - background-position: top right; - padding: 1px 1px 1px 1px; - overflow: hidden; -} - -input[type=checkbox], -select -{ - cursor:pointer; -} - +/* ------------------------------------------------------------------------ */ /* table styles */ .full @@ -572,4 +575,32 @@ select .stretch { width:100%; +} +.fixed +{ + min-width:100px; +} + +/* ------------------------------------------------------------------------ */ + +/* fonts */ +.base-font { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: normal; +} +.big-font { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; +} +.medium-font { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10.5px; + font-weight: normal; +} +.small-font { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + font-weight: normal; } \ No newline at end of file diff --git a/WebContent/main.html b/WebContent/main.html index 96cdad7f6..8c1663bae 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -81,55 +81,49 @@ or see http://www.gnu.org/licenses/agpl.txt. - +
+ +
+
Configuraion
-
-
Configuraion
-
-
-
Language:
-
-
-
Units:
-
-
-
- + +
+
+
Language:
+
+
+
+
Units:
+
+
+
- -
-
Mapping Tools
-
-
-
- -Highlight unnamed streets -
-
-
-
- -Show previous routes -
-
-
- -
-
- + +
+
Mapping Tools
+ + +
+
+
+
Highlight unnamed streets
+
+
+
+
Show previous routes
+
+
+ OSM BugsJOSM
@@ -181,5 +175,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
+ diff --git a/WebContent/printing/printing.css b/WebContent/printing/printing.css index 9b9d75bb5..929d4b39a 100644 --- a/WebContent/printing/printing.css +++ b/WebContent/printing/printing.css @@ -32,13 +32,10 @@ body top:0px; height:20px; } -.top-left-button -{ - float:left; -} .top-right-button { float:right; + vertical-align:top; } From 1ec7c6ab50725656aea03bef4930a4156f2c0a3b Mon Sep 17 00:00:00 2001 From: shiin Date: Sat, 12 May 2012 11:33:05 +0200 Subject: [PATCH 42/72] did some renaming --- WebContent/base/OSRM.Markers.js | 14 +++---- WebContent/routing/OSRM.Routing.js | 62 +++++++++++++++--------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/WebContent/base/OSRM.Markers.js b/WebContent/base/OSRM.Markers.js index 444020107..fb202879c 100644 --- a/WebContent/base/OSRM.Markers.js +++ b/WebContent/base/OSRM.Markers.js @@ -98,13 +98,13 @@ reverseMarkers: function() { // switch positions in nodes var temp_position = this.route[0].getPosition(); this.route[0].setPosition( this.route[size-1].getPosition() ); - OSRM.G.markers.route[size-1].setPosition( temp_position ); + this.route[size-1].setPosition( temp_position ); // switch nodes in array - var temp_node = OSRM.G.markers.route[0]; - OSRM.G.markers.route[0] = OSRM.G.markers.route[size-1]; - OSRM.G.markers.route[size-1] = temp_node; + var temp_node = this.route[0]; + this.route[0] = this.route[size-1]; + this.route[size-1] = temp_node; // reverse route - OSRM.G.markers.route.reverse(); + this.route.reverse(); // clear information (both delete markers stay visible) document.getElementById('information-box').innerHTML = ""; document.getElementById('information-box-header').innerHTML = ""; @@ -123,12 +123,12 @@ reverseMarkers: function() { }, hasSource: function() { - if( OSRM.G.markers.route[0] && OSRM.G.markers.route[0].label == OSRM.C.SOURCE_LABEL ) + if( this.route[0] && this.route[0].label == OSRM.C.SOURCE_LABEL ) return true; return false; }, hasTarget: function() { - if( OSRM.G.markers.route[OSRM.G.markers.route.length-1] && OSRM.G.markers.route[OSRM.G.markers.route.length-1].label == OSRM.C.TARGET_LABEL ) + if( this.route[this.route.length-1] && this.route[this.route.length-1].label == OSRM.C.TARGET_LABEL ) return true; return false; } diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 242b38f71..a0193681d 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -31,47 +31,28 @@ OSRM.Routing = { // init routing data structures init: function() { + OSRM.G.markers = new OSRM.Markers(); OSRM.G.route = new OSRM.Route(); - OSRM.G.markers = new OSRM.Markers(); }, // -- JSONP processing -- // process JSONP response of routing server -timeoutRouteSimple: function() { - OSRM.RoutingGeometry.showNA(); - OSRM.RoutingDescription.showNA( OSRM.loc("TIMED_OUT") ); -}, timeoutRoute: function() { OSRM.RoutingGeometry.showNA(); OSRM.RoutingNoNames.showNA(); OSRM.RoutingDescription.showNA( OSRM.loc("TIMED_OUT") ); OSRM.Routing._snapRoute(); }, -timeoutRouteReverse: function() { +timeoutRoute_Dragging: function() { + OSRM.RoutingGeometry.showNA(); + OSRM.RoutingDescription.showNA( OSRM.loc("TIMED_OUT") ); +}, +timeoutRoute_Reversed: function() { OSRM.G.markers.reverseMarkers(); timeoutRoute(); }, -showRouteSimple: function(response) { - if(!response) - return; - if( !OSRM.G.dragging ) // prevent simple routing when not dragging (required as there can be drag events after a dragstop event!) - return; - - if( response.status == 207) { - OSRM.RoutingGeometry.showNA(); - OSRM.RoutingDescription.showNA( OSRM.loc("YOUR_ROUTE_IS_BEING_COMPUTED") ); - } else { - OSRM.RoutingGeometry.show(response); - OSRM.RoutingDescription.showSimple(response); - OSRM.G.route.storeHistoryRoute(); - } - OSRM.Routing._updateHints(response); - - if(OSRM.G.pending) - setTimeout(OSRM.Routing.draggingTimeout,1); -}, showRoute: function(response) { if(!response) return; @@ -92,7 +73,26 @@ showRoute: function(response) { } OSRM.Routing._updateHints(response); }, -showRouteRedraw: function(response) { +showRoute_Dragging: function(response) { + if(!response) + return; + if( !OSRM.G.dragging ) // prevent simple routing when not dragging (required as there can be drag events after a dragstop event!) + return; + + if( response.status == 207) { + OSRM.RoutingGeometry.showNA(); + OSRM.RoutingDescription.showNA( OSRM.loc("YOUR_ROUTE_IS_BEING_COMPUTED") ); + } else { + OSRM.RoutingGeometry.show(response); + OSRM.RoutingDescription.showSimple(response); + OSRM.G.route.storeHistoryRoute(); + } + OSRM.Routing._updateHints(response); + + if(OSRM.G.pending) + setTimeout(OSRM.Routing.draggingTimeout,1); +}, +showRoute_Redraw: function(response) { if(!response) return; @@ -102,7 +102,7 @@ showRouteRedraw: function(response) { } OSRM.Routing._updateHints(response); }, -showRouteHistory: function(response, history_id) { +showRoute_RedrawHistory: function(response, history_id) { if(!response) return; @@ -136,7 +136,7 @@ getRoute_Reversed: function() { OSRM.JSONP.clear('dragging'); OSRM.JSONP.clear('redraw'); OSRM.JSONP.clear('route'); - OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRouteReverse, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route'); + OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute, OSRM.Routing.timeoutRoute_Reversed, OSRM.DEFAULTS.JSONP_TIMEOUT, 'route'); }, getRoute_Redraw: function() { if( OSRM.G.markers.route.length < 2 ) @@ -144,17 +144,17 @@ getRoute_Redraw: function() { OSRM.JSONP.clear('dragging'); OSRM.JSONP.clear('redraw'); - OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRouteRedraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw'); + OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute_Redraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw'); }, getRoute_RedrawHistory: function() { for(var i=0; i<10; i++) if( OSRM.G.route._history_data[i].length > 0 ) { OSRM.JSONP.clear('history'+i); - OSRM.JSONP.call(OSRM.Routing._buildHistoryCall(i)+'&instructions=false', OSRM.Routing.showRouteHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); + OSRM.JSONP.call(OSRM.Routing._buildHistoryCall(i)+'&instructions=false', OSRM.Routing.showRoute_RedrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); } }, getRoute_Dragging: function() { - OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRouteSimple, OSRM.Routing.timeoutRouteSimple, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');; + OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRoute_Dragging, OSRM.Routing.timeoutRoute_Dragging, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');; }, draggingTimeout: function() { OSRM.G.markers.route[OSRM.G.dragid].hint = null; From e9736173b0f54af99474b78fb950df89aedc3d83 Mon Sep 17 00:00:00 2001 From: shiin Date: Sun, 13 May 2012 12:51:49 +0200 Subject: [PATCH 43/72] added clarifying comment to JSONP call --- WebContent/printing/OSRM.Printing.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index 9f2140fb2..5787b1f19 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -184,9 +184,10 @@ show: function(response) { print_window.OSRM.prefetchIcons( OSRM.G.images ); print_window.OSRM.drawMarkers( OSRM.G.markers.route ); - // draw route & query for better geometry + // draw route & query for better geometry print_window.OSRM.drawRoute( positions ); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&z='+zoom+'&instructions=false', OSRM.Printing.drawRoute, OSRM.Printing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'print'); + // NOTE: simply appended correct zoom level as second zoom parameter to JSONP call -> OSRM API only considers the last one! }, timeoutRoute: function() {}, drawRoute: function(response) { From 101fc5d02f86ec53bac1876effe52aa9bf0ab472 Mon Sep 17 00:00:00 2001 From: shiin Date: Sun, 13 May 2012 12:59:19 +0200 Subject: [PATCH 44/72] removed third parameter from OSRM.bind as it is no longer used --- WebContent/utils/OSRM.classes.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WebContent/utils/OSRM.classes.js b/WebContent/utils/OSRM.classes.js index b97be6770..14c8e292a 100644 --- a/WebContent/utils/OSRM.classes.js +++ b/WebContent/utils/OSRM.classes.js @@ -40,10 +40,9 @@ OSRM.extend = function( target_class, properties ) { // bind a function to an execution context, i.e. an object (needed for correcting this pointers) -OSRM.bind = function( context, fct1, fct2 ) { +OSRM.bind = function( context, fct1 ) { return function() { - if(fct1) fct1.apply(context, arguments); - if(fct2) fct2.apply(context, arguments); + fct1.apply(context, arguments); }; }; From 36f5b36c6b55f3830ed7b6695921a7515e2aaa42 Mon Sep 17 00:00:00 2001 From: shiin Date: Sun, 13 May 2012 20:28:24 +0200 Subject: [PATCH 45/72] more work on history routes --- WebContent/base/Backup.OSRM.HistoryRoutes.js | 178 ++++++++++++++++ WebContent/base/OSRM.HistoryRoutes.js | 212 +++++++++++++++++++ WebContent/base/OSRM.Map.js | 1 - WebContent/base/OSRM.Routes.js | 127 +++-------- WebContent/gui/OSRM.RoutingGUI.js | 6 +- WebContent/main.html | 1 + WebContent/routing/OSRM.Routing.js | 35 +-- 7 files changed, 427 insertions(+), 133 deletions(-) create mode 100644 WebContent/base/Backup.OSRM.HistoryRoutes.js create mode 100644 WebContent/base/OSRM.HistoryRoutes.js diff --git a/WebContent/base/Backup.OSRM.HistoryRoutes.js b/WebContent/base/Backup.OSRM.HistoryRoutes.js new file mode 100644 index 000000000..0a89d8caa --- /dev/null +++ b/WebContent/base/Backup.OSRM.HistoryRoutes.js @@ -0,0 +1,178 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets) +// [this holds the route geometry] + + +OSRM.HistoryRoute = function() { + // how to draw history routes and how many + this._history_styles = [{dashed:false, color:'#FFFFFF', opacity:0.5, weight:5}, + {dashed:false, color:'#0000DD', opacity:0.45, weight:5}, + {dashed:false, color:'#0000BB', opacity:0.40, weight:5}, + {dashed:false, color:'#000099', opacity:0.35, weight:5}, + {dashed:false, color:'#000077', opacity:0.30, weight:5}, + {dashed:false, color:'#000055', opacity:0.25, weight:5}, + {dashed:false, color:'#000033', opacity:0.20, weight:5}, + {dashed:false, color:'#000011', opacity:0.15, weight:5}, + {dashed:false, color:'#FF0000', opacity:0.50, weight:5} + ]; + this._history_routes = this._history_styles.length; + + // actual history data + this._history_route = []; + this._history_data = []; + for(var i=0, size=this._history_routes; i0; i--) { + this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); + this._history_data[i] = this._history_data[i-1]; + } + // reset staging spot + this._history_route[0].setPositions( [] ); + this._history_data[0] = []; + }, + _equalRoute: function() { + var lhs = OSRM.G.markers.route; + var rhs = this._history_data[0]; + for(var i=0,size=Math.min(rhs.length,lhs.length); i 0 ) { + OSRM.JSONP.clear('history'+i); + OSRM.JSONP.call(this._buildCall(i)+'&instructions=false', this._callback_redrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); + } + }, + _buildCall: function(history_id) { + var source = OSRM.DEFAULTS.HOST_ROUTING_URL; + source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp'; + var data = this._history_data[history_id]; + if(data.checksum) + source += '&checksum=' + data.checksum; + for(var i=0,size=data.length; i0; i--) { + this._history[i].route.setPositions( this._history[i-1].route.getPositions() ); // copying positions quicker than creating new route! + this._history[i].markers = this._history[i-1].markers; + this._history[i].checksum = this._history[i-1].checksum; + } + // reset staging spot + this._history[0].route.setPositions( [] ); + this._history[0].markers = []; + this._history[0].checksum = null; + + console.log("fetch", this._history[1].markers); + }, + _showHistoryRoutes: function() { + console.log("show"); + for(var i=1,size=this._history_length; i 0 ) { + OSRM.JSONP.clear('history'+i); + OSRM.JSONP.call(this._buildCall(i)+'&instructions=false', this._callback_redrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); + } + }, + _buildCall: function(history_id) { + var source = OSRM.DEFAULTS.HOST_ROUTING_URL; + source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp'; + + if(this._history[history_id].checksum) + source += '&checksum=' + this._history[history_id].checksum; + + var history_markers = this._history[history_id].markers; + for(var i=0,size=history_markers.length; i0; i--) { - this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); - this._history_data[i] = this._history_data[i-1]; - } - // reset staging spot - this._history_route[0].setPositions( [] ); - this._history_data[0] = []; - }, - _equalRoute: function() { - var lhs = OSRM.G.markers.route; - var rhs = this._history_data[0]; - for(var i=0,size=Math.min(rhs.length,lhs.length); i + diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index a0193681d..e6f29700f 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -69,7 +69,6 @@ showRoute: function(response) { OSRM.RoutingNoNames.show(response); OSRM.RoutingDescription.show(response); OSRM.Routing._snapRoute(); - OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); }, @@ -78,14 +77,14 @@ showRoute_Dragging: function(response) { return; if( !OSRM.G.dragging ) // prevent simple routing when not dragging (required as there can be drag events after a dragstop event!) return; - + + OSRM.G.response = response; if( response.status == 207) { OSRM.RoutingGeometry.showNA(); OSRM.RoutingDescription.showNA( OSRM.loc("YOUR_ROUTE_IS_BEING_COMPUTED") ); } else { OSRM.RoutingGeometry.show(response); OSRM.RoutingDescription.showSimple(response); - OSRM.G.route.storeHistoryRoute(); } OSRM.Routing._updateHints(response); @@ -102,16 +101,6 @@ showRoute_Redraw: function(response) { } OSRM.Routing._updateHints(response); }, -showRoute_RedrawHistory: function(response, history_id) { - if(!response) - return; - - if(response.status != 207) { - var positions = OSRM.RoutingGeometry._decode(response.route_geometry, 5); - OSRM.G.route._history_route[history_id].setPositions(positions); - } -}, - //-- main function -- @@ -146,13 +135,6 @@ getRoute_Redraw: function() { OSRM.JSONP.clear('redraw'); OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=true', OSRM.Routing.showRoute_Redraw, OSRM.Routing.timeoutRoute, OSRM.DEFAULTS.JSONP_TIMEOUT, 'redraw'); }, -getRoute_RedrawHistory: function() { - for(var i=0; i<10; i++) - if( OSRM.G.route._history_data[i].length > 0 ) { - OSRM.JSONP.clear('history'+i); - OSRM.JSONP.call(OSRM.Routing._buildHistoryCall(i)+'&instructions=false', OSRM.Routing.showRoute_RedrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); - } -}, getRoute_Dragging: function() { OSRM.G.pending = !OSRM.JSONP.call(OSRM.Routing._buildCall()+'&instructions=false', OSRM.Routing.showRoute_Dragging, OSRM.Routing.timeoutRoute_Dragging, OSRM.DEFAULTS.JSONP_TIMEOUT, 'dragging');; }, @@ -174,19 +156,6 @@ _buildCall: function() { } return source; }, -_buildHistoryCall: function(history_id) { - var source = OSRM.DEFAULTS.HOST_ROUTING_URL; - source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp'; - if(OSRM.G.markers.checksum) - source += '&checksum=' + OSRM.G.markers.checksum; - var markers = OSRM.G.route._history_data[history_id]; - for(var i=0,size=markers.length; i Date: Mon, 14 May 2012 07:06:29 +0100 Subject: [PATCH 46/72] correction for IE css --- WebContent/main.css | 1 + 1 file changed, 1 insertion(+) diff --git a/WebContent/main.css b/WebContent/main.css index efe027180..4346f1b75 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -433,6 +433,7 @@ html, body { .mapping-checkbox { margin: 0px 5px 3px 5px; + padding: 0px; } .mapping-button { From 0976358fdf5073ee053fe775919010bd5f517575 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 14 May 2012 07:12:29 +0100 Subject: [PATCH 47/72] added comment --- WebContent/routing/OSRM.Routing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index e6f29700f..a3318922c 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -57,7 +57,7 @@ showRoute: function(response) { if(!response) return; - OSRM.G.response = response; + OSRM.G.response = response; // needed for printing & history routes! OSRM.G.via_points = response.via_points.slice(0); if(response.status == 207) { OSRM.RoutingGeometry.showNA(); @@ -78,7 +78,7 @@ showRoute_Dragging: function(response) { if( !OSRM.G.dragging ) // prevent simple routing when not dragging (required as there can be drag events after a dragstop event!) return; - OSRM.G.response = response; + OSRM.G.response = response; // needed for history routes! if( response.status == 207) { OSRM.RoutingGeometry.showNA(); OSRM.RoutingDescription.showNA( OSRM.loc("YOUR_ROUTE_IS_BEING_COMPUTED") ); From 979327ec82fb03ef945d3695ee9d74fc80b785fa Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 14 May 2012 12:18:04 +0100 Subject: [PATCH 48/72] refactored code for history routes --- WebContent/base/Backup.OSRM.HistoryRoutes.js | 178 ------------------- WebContent/base/OSRM.HistoryRoutes.js | 69 +++---- WebContent/base/OSRM.Via.js | 10 +- WebContent/routing/OSRM.Routing.js | 14 +- 4 files changed, 38 insertions(+), 233 deletions(-) delete mode 100644 WebContent/base/Backup.OSRM.HistoryRoutes.js diff --git a/WebContent/base/Backup.OSRM.HistoryRoutes.js b/WebContent/base/Backup.OSRM.HistoryRoutes.js deleted file mode 100644 index 0a89d8caa..000000000 --- a/WebContent/base/Backup.OSRM.HistoryRoutes.js +++ /dev/null @@ -1,178 +0,0 @@ -/* -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU AFFERO General Public License as published by -the Free Software Foundation; either version 3 of the License, or -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -or see http://www.gnu.org/licenses/agpl.txt. -*/ - -// OSRM route management (handles drawing of route geometry - current route, old route, unnamed route, highlight unnamed streets) -// [this holds the route geometry] - - -OSRM.HistoryRoute = function() { - // how to draw history routes and how many - this._history_styles = [{dashed:false, color:'#FFFFFF', opacity:0.5, weight:5}, - {dashed:false, color:'#0000DD', opacity:0.45, weight:5}, - {dashed:false, color:'#0000BB', opacity:0.40, weight:5}, - {dashed:false, color:'#000099', opacity:0.35, weight:5}, - {dashed:false, color:'#000077', opacity:0.30, weight:5}, - {dashed:false, color:'#000055', opacity:0.25, weight:5}, - {dashed:false, color:'#000033', opacity:0.20, weight:5}, - {dashed:false, color:'#000011', opacity:0.15, weight:5}, - {dashed:false, color:'#FF0000', opacity:0.50, weight:5} - ]; - this._history_routes = this._history_styles.length; - - // actual history data - this._history_route = []; - this._history_data = []; - for(var i=0, size=this._history_routes; i0; i--) { - this._history_route[i].setPositions( this._history_route[i-1].getPositions() ); - this._history_data[i] = this._history_data[i-1]; - } - // reset staging spot - this._history_route[0].setPositions( [] ); - this._history_data[0] = []; - }, - _equalRoute: function() { - var lhs = OSRM.G.markers.route; - var rhs = this._history_data[0]; - for(var i=0,size=Math.min(rhs.length,lhs.length); i 0 ) { - OSRM.JSONP.clear('history'+i); - OSRM.JSONP.call(this._buildCall(i)+'&instructions=false', this._callback_redrawHistory, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'history'+i, i); - } - }, - _buildCall: function(history_id) { - var source = OSRM.DEFAULTS.HOST_ROUTING_URL; - source += '?z=' + OSRM.G.map.getZoom() + '&output=json&jsonp=%jsonp&geomformat=cmp'; - var data = this._history_data[history_id]; - if(data.checksum) - source += '&checksum=' + data.checksum; - for(var i=0,size=data.length; i0; i--) { @@ -118,18 +111,15 @@ OSRM.extend( OSRM.HistoryRoute,{ this._history[0].route.setPositions( [] ); this._history[0].markers = []; this._history[0].checksum = null; - - console.log("fetch", this._history[1].markers); }, _showHistoryRoutes: function() { - console.log("show"); for(var i=1,size=this._history_length; i nearest_index) { new_via_index = i; break; diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index a3318922c..9c3bd8ff8 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -58,7 +58,6 @@ showRoute: function(response) { return; OSRM.G.response = response; // needed for printing & history routes! - OSRM.G.via_points = response.via_points.slice(0); if(response.status == 207) { OSRM.RoutingGeometry.showNA(); OSRM.RoutingNoNames.showNA(); @@ -95,6 +94,7 @@ showRoute_Redraw: function(response) { if(!response) return; + //OSRM.G.response = response; // not needed, even harmful as important information is not stored! if(response.status != 207) { OSRM.RoutingGeometry.show(response); OSRM.RoutingNoNames.show(response); @@ -171,11 +171,13 @@ _updateHints: function(response) { // snap all markers to the received route _snapRoute: function() { var positions = OSRM.G.route.getPositions(); - - OSRM.G.markers.route[0].setPosition( positions[0] ); - OSRM.G.markers.route[OSRM.G.markers.route.length-1].setPosition( positions[positions.length-1] ); - for(var i=0; i Date: Mon, 14 May 2012 15:39:59 +0100 Subject: [PATCH 49/72] added Italien translsation (thanks to sabas), clarified procedure to add commits --- AUTHORS.md | 3 +- README.md | 7 +- WebContent/OSRM.config.js | 1 + WebContent/localization/OSRM.Locale.it.js | 104 ++++++++++++++++++++++ 4 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 WebContent/localization/OSRM.Locale.it.js diff --git a/AUTHORS.md b/AUTHORS.md index 5ee70cc13..1aa44a2ae 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,4 +8,5 @@ Nicolas Belett Vigneron Moyg Jean-Frederic Zbigniew Czernik -Jonas Häggqvist \ No newline at end of file +Jonas Häggqvist +Sabas \ No newline at end of file diff --git a/README.md b/README.md index dd77af2c8..0b40dea4e 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,10 @@ Please use the OSRM-Project bug tracker [(4)] for submitting any bug reports or Contribute ---------- -If you like to contribute, you can simply fork the project and start coding. -When you are going to provide a more substantial addition, please create a new branch first. -For pull requests use the develop branch as target, never the master branch. +If you like to contribute, simply fork the project and start coding. +It is best practice to create a new branch (from the current master) with a descriptive name for your contributions. +When you are done, send a pull request from that branch. +With this workflow, each pull request is isolated and can be easily merged. Integration into Project-OSRM repository diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 733615763..63f19f3cb 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -47,6 +47,7 @@ OSRM.DEFAULTS = { {encoding:"de", name:"Deutsch"}, {encoding:"fi", name:"Suomi"}, {encoding:"fr", name:"Français"}, + {encoding:"it", name:"Italiano"}, {encoding:"pl", name:"Polski"} ], diff --git a/WebContent/localization/OSRM.Locale.it.js b/WebContent/localization/OSRM.Locale.it.js new file mode 100644 index 000000000..99f852c9a --- /dev/null +++ b/WebContent/localization/OSRM.Locale.it.js @@ -0,0 +1,104 @@ +/* +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. +*/ + +// OSRM localization +// [Italian language support] + + +OSRM.Localization["it"] = { +// own language +"LANGUAGE": "Italiano", +//gui +"GUI_START": "Partenza", +"GUI_END": "Destinazione", +"GUI_RESET": "Reset", +"GUI_SEARCH": "Mostra", +"GUI_REVERSE": "Inverti", +"GUI_START_TOOLTIP": "Inserire la Partenza", +"GUI_END_TOOLTIP": "Inserire la destinazione", +"GUI_LEGAL_NOTICE": "GUI2 v"+OSRM.VERSION+" "+OSRM.DATE+" - OSRM hosting by KIT - Geocoder by OSM", +//config +"GUI_CONFIGURATION": "Configurazione", +"GUI_LANGUAGE": "Lingua", +"GUI_UNITS": "Unità", +"GUI_KILOMETERS": "Chilometri", +"GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", +// mapping +"GUI_MAPPING_TOOLS": "Strumenti per la Mappatura", +"GUI_HIGHLIGHT_UNNAMED_ROADS": "Evidenzia strade senza nome", +"GUI_SHOW_PREVIOUS_ROUTES": "Show previous routes", +"OPEN_JOSM": "JOSM", +"OPEN_OSMBUGS": "OSM Bugs", +// geocoder +"SEARCH_RESULTS": "Risultati della ricerca", +"FOUND_X_RESULTS": "trovati %i risultati", +"TIMED_OUT": "Timeout", +"NO_RESULTS_FOUND": "Nessun risultato trovato", +"NO_RESULTS_FOUND_SOURCE": "Nessun risultato trovato per la partenza", +"NO_RESULTS_FOUND_TARGET": "Nessun risultato trovato per la destinazione", +//routing +"ROUTE_DESCRIPTION": "Descrizione del percorso", +"GET_LINK_TO_ROUTE": "Genera un Link", +"GENERATE_LINK_TO_ROUTE": "in attesa del link", +"LINK_TO_ROUTE_TIMEOUT": "non disponibile", +"GPX_FILE": "File GPX", +"DISTANCE": "Distanza", +"DURATION": "Durata", +"YOUR_ROUTE_IS_BEING_COMPUTED": "Sto calcolando il tuo percorso", +"NO_ROUTE_FOUND": "Nessun percorso possibile", +//printing +"OVERVIEW_MAP": "Mappa d'insieme", +// directions +"N": "nord", +"E": "est", +"S": "sud", +"W": "ovest", +"NE": "nordest", +"SE": "sudest", +"SW": "sudovest", +"NW": "nordovest", +// driving directions +// %s: road name +// %d: direction +// [*]: will only be printed when there actually is a road name +"DIRECTION_0":"Istruzione sconosciuta[ su %s]", +"DIRECTION_1":"Continuare[ su %s]", +"DIRECTION_2":"Girare leggermente a destra[ su %s]", +"DIRECTION_3":"Girare a destra[ su %s]", +"DIRECTION_4":"Girare decisamente a destra[ su %s]", +"DIRECTION_5":"Compire una inversione ad U[ su %s]", +"DIRECTION_6":"Girare leggermente a sinistra[ su %s]", +"DIRECTION_7":"Girare a sinistra[ su %s]", +"DIRECTION_8":"Girare decisamente a sinistra[ su %s]", +"DIRECTION_10":"Dirigersi a %d[ su %s]", +"DIRECTION_11-1":"Immettersi nella rotonda ed abbandonarla alla prima uscita[ su %s]", +"DIRECTION_11-2":"Immettersi nella rotonda ed abbandonarla alla seconda uscita[ su %s]", +"DIRECTION_11-3":"Immettersi nella rotonda ed abbandonarla alla terza uscita[ su %s]", +"DIRECTION_11-4":"Immettersi nella rotonda ed abbandonarla alla quarta uscita[ su %s]", +"DIRECTION_11-5":"Immettersi nella rotonda ed abbandonarla alla quinta uscita[ su %s]", +"DIRECTION_11-6":"Immettersi nella rotonda ed abbandonarla alla sesta uscita[ su %s]", +"DIRECTION_11-7":"Immettersi nella rotonda ed abbandonarla alla settima uscita[ su %s]", +"DIRECTION_11-8":"Immettersi nella rotonda ed abbandonarla alla ottava uscita[ su %s]", +"DIRECTION_11-9":"Immettersi nella rotonda ed abbandonarla alla nona uscita[ su %s]", +"DIRECTION_11-x":"Immettersi nella rotonda ed abbandonarla ad una delle tante uscite[ su %s]", +"DIRECTION_15":"Hai raggiunto la tua destinazione" +}; + +//set GUI language on load +if( OSRM.DEFAULTS.LANUGAGE_ONDEMAND_RELOADING == true ) + OSRM.Localization.setLanguage("it"); From f266655b9b06cbd941a6d52123360aa8007ec2cc Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 14 May 2012 15:40:23 +0100 Subject: [PATCH 50/72] added data update date --- WebContent/gui/OSRM.MainGUI.js | 14 ++++++++++++++ WebContent/localization/OSRM.Locale.de.js | 1 + WebContent/localization/OSRM.Locale.dk.js | 1 + WebContent/localization/OSRM.Locale.en.js | 1 + WebContent/localization/OSRM.Locale.fi.js | 1 + WebContent/localization/OSRM.Locale.fr.js | 1 + WebContent/localization/OSRM.Locale.pl.js | 1 + WebContent/main.css | 1 - WebContent/main.html | 7 +++++++ 9 files changed, 27 insertions(+), 1 deletion(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index cca1eccd4..5d8b7ddf6 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -43,6 +43,10 @@ init: function() { // init units selector OSRM.GUI.selectorInit( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged ); + + // query last update of data + OSRM.G.data_updated = "n/a"; + OSRM.JSONP.call('OSRM.DEFAULTS.HOST_ROUTING_URL?data_updated=true', OSRM.GUI.setDataUpdated, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_updated'); }, // set language dependent labels @@ -64,6 +68,7 @@ setLabels: function() { document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION"); document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":"; document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":"; + document.getElementById('gui-data-updated').innerHTML = OSRM.loc("GUI_DATA_UPDATED")+": " + OSRM.G.data_updated; document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS"); document.getElementById("gui-units-toggle").getElementsByTagName("option")[1].innerHTML = OSRM.loc("GUI_MILES"); @@ -96,6 +101,15 @@ afterMainTransition: function() { onUnitsChanged: function(value) { OSRM.Utils.setToHumanDistanceFunction(value); OSRM.Routing.getRoute(); +}, + +// set time when data was last updated +setDataUpdated: function(response) { + if(!response) + return; + + OSRM.G.data_updated = response.data_updated; + document.getElementById('gui-data-updated').innerHTML = OSRM.loc("GUI_DATA_UPDATED")+": " + OSRM.G.data_updated; } }); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js index bd28ef88d..68ff6741f 100644 --- a/WebContent/localization/OSRM.Locale.de.js +++ b/WebContent/localization/OSRM.Locale.de.js @@ -37,6 +37,7 @@ OSRM.Localization["de"] = { "GUI_UNITS": "Einheiten", "GUI_KILOMETERS": "Kilometer", "GUI_MILES": "Meilen", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "Kartenwerkzeuge", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben", diff --git a/WebContent/localization/OSRM.Locale.dk.js b/WebContent/localization/OSRM.Locale.dk.js index 520a44510..f2cd75ebf 100644 --- a/WebContent/localization/OSRM.Locale.dk.js +++ b/WebContent/localization/OSRM.Locale.dk.js @@ -37,6 +37,7 @@ OSRM.Localization["dk"] = { "GUI_UNITS": "Enheder", "GUI_KILOMETERS": "Kilometer", "GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "Kortlægnings værktøjer", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje", diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js index db52d28a8..1d386b9a7 100644 --- a/WebContent/localization/OSRM.Locale.en.js +++ b/WebContent/localization/OSRM.Locale.en.js @@ -37,6 +37,7 @@ OSRM.Localization["en"] = { "GUI_UNITS": "Units", "GUI_KILOMETERS": "Kilometers", "GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "Mapping Tools", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", diff --git a/WebContent/localization/OSRM.Locale.fi.js b/WebContent/localization/OSRM.Locale.fi.js index 37df99c93..f889cf180 100644 --- a/WebContent/localization/OSRM.Locale.fi.js +++ b/WebContent/localization/OSRM.Locale.fi.js @@ -37,6 +37,7 @@ OSRM.Localization["fi"] = { "GUI_UNITS": "Yksiköt", "GUI_KILOMETERS": "Kilometri", "GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "Kartoitustyökalut", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet", diff --git a/WebContent/localization/OSRM.Locale.fr.js b/WebContent/localization/OSRM.Locale.fr.js index 49c8931ac..2aa7bd420 100644 --- a/WebContent/localization/OSRM.Locale.fr.js +++ b/WebContent/localization/OSRM.Locale.fr.js @@ -37,6 +37,7 @@ OSRM.Localization["fr"] = { "GUI_UNITS": "Unités", "GUI_KILOMETERS": "Kilomètres", "GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "Outils de cartographie", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom", diff --git a/WebContent/localization/OSRM.Locale.pl.js b/WebContent/localization/OSRM.Locale.pl.js index abcb6ac56..4aa773d9a 100644 --- a/WebContent/localization/OSRM.Locale.pl.js +++ b/WebContent/localization/OSRM.Locale.pl.js @@ -37,6 +37,7 @@ OSRM.Localization["pl"] = { "GUI_UNITS": "Jednostki", "GUI_KILOMETERS": "Kilometrów", "GUI_MILES": "Miles", +"GUI_DATA_UPDATED": "data", // mapping "GUI_MAPPING_TOOLS": "NarzÄ™dzia mapowania", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy", diff --git a/WebContent/main.css b/WebContent/main.css index 4346f1b75..dc90c73df 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -440,7 +440,6 @@ html, body { float: right; } - /* ------------------------------------------------------------------------ */ /* buttons */ diff --git a/WebContent/main.html b/WebContent/main.html index 42d51ccea..af4be1b79 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -103,6 +103,13 @@ or see http://www.gnu.org/licenses/agpl.txt.
+ + +
+
+
data: n/a
+
+
From 40900f6f568040898ed58b0f8e8bac044aefedbc Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 14 May 2012 16:31:24 +0100 Subject: [PATCH 51/72] put Danish after German (de < dk) --- WebContent/OSRM.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 63f19f3cb..da6e7ac32 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -43,8 +43,8 @@ OSRM.DEFAULTS = { LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ {encoding:"en", name:"English"}, - {encoding:"dk", name:"Dansk"}, {encoding:"de", name:"Deutsch"}, + {encoding:"dk", name:"Dansk"}, {encoding:"fi", name:"Suomi"}, {encoding:"fr", name:"Français"}, {encoding:"it", name:"Italiano"}, From 9e5689858e9e08bba097d8ddfcdc4f31c978fe52 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Mon, 14 May 2012 17:12:02 +0100 Subject: [PATCH 52/72] when checking if two routes are equal, only check up to 5 digits --- WebContent/base/OSRM.HistoryRoutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index cf4b663fe..caa17acce 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -148,7 +148,7 @@ OSRM.extend( OSRM.HistoryRoute,{ if(lhs.length != rhs.length) return false; for(var i=0,size=lhs.length; i Date: Mon, 14 May 2012 17:50:17 +0100 Subject: [PATCH 53/72] data_updated -> data_timestamp --- WebContent/OSRM.config.js | 1 + WebContent/base/OSRM.HistoryRoutes.js | 2 +- WebContent/gui/OSRM.MainGUI.js | 14 +++++++------- WebContent/localization/OSRM.Locale.de.js | 2 +- WebContent/localization/OSRM.Locale.dk.js | 2 +- WebContent/localization/OSRM.Locale.en.js | 2 +- WebContent/localization/OSRM.Locale.fi.js | 2 +- WebContent/localization/OSRM.Locale.fr.js | 2 +- WebContent/localization/OSRM.Locale.it.js | 2 +- WebContent/localization/OSRM.Locale.pl.js | 2 +- WebContent/main.html | 4 ++-- 11 files changed, 18 insertions(+), 17 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index da6e7ac32..5aa3115f6 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -21,6 +21,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.DEFAULTS = { HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', + HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search', HOST_REVERSE_GEOCODER_URL: 'http://nominatim.openstreetmap.org/reverse', WEBSITE_URL: document.URL.replace(/#*(\?.*|$)/i,""), // truncates URL before first ?, and removes tailing # diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index caa17acce..7f11b44da 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -128,7 +128,7 @@ OSRM.extend( OSRM.HistoryRoute,{ } }, - // get positions of current markers (note: data of jsonp response used, as not all data structures updated!) + // get positions of current markers (data of jsonp response used, as not all data structures up-to-date!) _getCurrentMarkers: function() { var route = []; diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 5d8b7ddf6..7d5a91ef6 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -45,8 +45,8 @@ init: function() { OSRM.GUI.selectorInit( "gui-units-toggle", [{display:"Kilometers",value:0},{display:"Miles",value:1}], 0, OSRM.GUI.onUnitsChanged ); // query last update of data - OSRM.G.data_updated = "n/a"; - OSRM.JSONP.call('OSRM.DEFAULTS.HOST_ROUTING_URL?data_updated=true', OSRM.GUI.setDataUpdated, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_updated'); + OSRM.G.data_timestamp = "n/a"; + OSRM.JSONP.call('OSRM.DEFAULTS.HOST_TIMESTAMP_URL', OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); }, // set language dependent labels @@ -68,7 +68,7 @@ setLabels: function() { document.getElementById("gui-config-label").innerHTML = OSRM.loc("GUI_CONFIGURATION"); document.getElementById("gui-language-2-label").innerHTML = OSRM.loc("GUI_LANGUAGE")+":"; document.getElementById("gui-units-label").innerHTML = OSRM.loc("GUI_UNITS")+":"; - document.getElementById('gui-data-updated').innerHTML = OSRM.loc("GUI_DATA_UPDATED")+": " + OSRM.G.data_updated; + document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp; document.getElementById("gui-units-toggle").getElementsByTagName("option")[0].innerHTML = OSRM.loc("GUI_KILOMETERS"); document.getElementById("gui-units-toggle").getElementsByTagName("option")[1].innerHTML = OSRM.loc("GUI_MILES"); @@ -103,13 +103,13 @@ onUnitsChanged: function(value) { OSRM.Routing.getRoute(); }, -// set time when data was last updated -setDataUpdated: function(response) { +// set timestamp of data +setDataTimestamp: function(response) { if(!response) return; - OSRM.G.data_updated = response.data_updated; - document.getElementById('gui-data-updated').innerHTML = OSRM.loc("GUI_DATA_UPDATED")+": " + OSRM.G.data_updated; + OSRM.G.data_timestamp = response.timestamp; + document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp; } }); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js index 68ff6741f..29fcf1a4f 100644 --- a/WebContent/localization/OSRM.Locale.de.js +++ b/WebContent/localization/OSRM.Locale.de.js @@ -37,7 +37,7 @@ OSRM.Localization["de"] = { "GUI_UNITS": "Einheiten", "GUI_KILOMETERS": "Kilometer", "GUI_MILES": "Meilen", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Kartenwerkzeuge", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Unbenannte Straßen hervorheben", diff --git a/WebContent/localization/OSRM.Locale.dk.js b/WebContent/localization/OSRM.Locale.dk.js index f2cd75ebf..91850e5b0 100644 --- a/WebContent/localization/OSRM.Locale.dk.js +++ b/WebContent/localization/OSRM.Locale.dk.js @@ -37,7 +37,7 @@ OSRM.Localization["dk"] = { "GUI_UNITS": "Enheder", "GUI_KILOMETERS": "Kilometer", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Kortlægnings værktøjer", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Fremhæv unavngivne veje", diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js index 1d386b9a7..f4ab40d28 100644 --- a/WebContent/localization/OSRM.Locale.en.js +++ b/WebContent/localization/OSRM.Locale.en.js @@ -37,7 +37,7 @@ OSRM.Localization["en"] = { "GUI_UNITS": "Units", "GUI_KILOMETERS": "Kilometers", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Mapping Tools", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Highlight unnamed streets", diff --git a/WebContent/localization/OSRM.Locale.fi.js b/WebContent/localization/OSRM.Locale.fi.js index f889cf180..bebfe5325 100644 --- a/WebContent/localization/OSRM.Locale.fi.js +++ b/WebContent/localization/OSRM.Locale.fi.js @@ -37,7 +37,7 @@ OSRM.Localization["fi"] = { "GUI_UNITS": "Yksiköt", "GUI_KILOMETERS": "Kilometri", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Kartoitustyökalut", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Korosta nimettömät tiet", diff --git a/WebContent/localization/OSRM.Locale.fr.js b/WebContent/localization/OSRM.Locale.fr.js index 2aa7bd420..ecc256f88 100644 --- a/WebContent/localization/OSRM.Locale.fr.js +++ b/WebContent/localization/OSRM.Locale.fr.js @@ -37,7 +37,7 @@ OSRM.Localization["fr"] = { "GUI_UNITS": "Unités", "GUI_KILOMETERS": "Kilomètres", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Outils de cartographie", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Surligner les rues sans nom", diff --git a/WebContent/localization/OSRM.Locale.it.js b/WebContent/localization/OSRM.Locale.it.js index 99f852c9a..c8b6ad717 100644 --- a/WebContent/localization/OSRM.Locale.it.js +++ b/WebContent/localization/OSRM.Locale.it.js @@ -37,7 +37,7 @@ OSRM.Localization["it"] = { "GUI_UNITS": "Unità", "GUI_KILOMETERS": "Chilometri", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Strumenti per la Mappatura", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Evidenzia strade senza nome", diff --git a/WebContent/localization/OSRM.Locale.pl.js b/WebContent/localization/OSRM.Locale.pl.js index 4aa773d9a..66c2eda71 100644 --- a/WebContent/localization/OSRM.Locale.pl.js +++ b/WebContent/localization/OSRM.Locale.pl.js @@ -37,7 +37,7 @@ OSRM.Localization["pl"] = { "GUI_UNITS": "Jednostki", "GUI_KILOMETERS": "Kilometrów", "GUI_MILES": "Miles", -"GUI_DATA_UPDATED": "data", +"GUI_DATA_TIMESTAMP": "data", // mapping "GUI_MAPPING_TOOLS": "Narzędzia mapowania", "GUI_HIGHLIGHT_UNNAMED_ROADS": "Zaznacz ulice bez nazwy", diff --git a/WebContent/main.html b/WebContent/main.html index af4be1b79..3b32ab10d 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -104,10 +104,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
- +
-
data: n/a
+
data: n/a
From a53a34a261721755bc54e2047cc5149a90153dec Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 10:08:40 +0100 Subject: [PATCH 54/72] integrated attribution fix to Leaflet code --- WebContent/leaflet/leaflet-src.js | 2 +- WebContent/leaflet/leaflet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/leaflet/leaflet-src.js b/WebContent/leaflet/leaflet-src.js index 4f0b7c1f0..f65851fc7 100644 --- a/WebContent/leaflet/leaflet-src.js +++ b/WebContent/leaflet/leaflet-src.js @@ -4912,7 +4912,7 @@ L.Control.Attribution = L.Class.extend({ var attribs = []; for (var i in this._attributions) { - if (this._attributions.hasOwnProperty(i)) { + if (this._attributions.hasOwnProperty(i) && this._attributions[i]) { // DS_CHANGE: fix for attribution bug (also changed in leaflet.js!) attribs.push(i); } } diff --git a/WebContent/leaflet/leaflet.js b/WebContent/leaflet/leaflet.js index a2bebba1c..e02f0d5f8 100644 --- a/WebContent/leaflet/leaflet.js +++ b/WebContent/leaflet/leaflet.js @@ -3,4 +3,4 @@ Leaflet is a modern open-source JavaScript library for interactive maps. http://leaflet.cloudmade.com */ -(function(a){a.L={VERSION:"0.3",ROOT_URL:a.L_ROOT_URL||function(){var a=document.getElementsByTagName("script"),b=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/,c,d,e,f;for(c=0,d=a.length;c0},removeEventListener:function(a,b,c){if(!this.hasEventListeners(a))return this;for(var d=0,e=this._leaflet_events,f=e[a].length;d=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){var b=this.min,c=this.max,d=a.min,e=a.max,f=e.x>=b.x&&d.x<=c.x,g=e.y>=b.y&&d.y<=c.y;return f&&g}}),L.Transformation=L.Class.extend({initialize:function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new L.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}}),L.DomUtil={get:function(a){return typeof a=="string"?document.getElementById(a):a},getStyle:function(a,b){var c=a.style[b];!c&&a.currentStyle&&(c=a.currentStyle[b]);if(!c||c==="auto"){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}return c==="auto"?null:c},getViewportOffset:function(a){var b=0,c=0,d=a,e=document.body;do{b+=d.offsetTop||0,c+=d.offsetLeft||0;if(d.offsetParent===e&&L.DomUtil.getStyle(d,"position")==="absolute")break;d=d.offsetParent}while(d);d=a;do{if(d===e)break;b-=d.scrollTop||0,c-=d.scrollLeft||0,d=d.parentNode}while(d);return new L.Point(c,b)},create:function(a,b,c){var d=document.createElement(a);return d.className=b,c&&c.appendChild(d),d},disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty(),this._onselectstart||(this._onselectstart=document.onselectstart,document.onselectstart=L.Util.falseFn)},enableTextSelection:function(){document.onselectstart=this._onselectstart,this._onselectstart=null},hasClass:function(a,b){return a.className.length>0&&RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},addClass:function(a,b){L.DomUtil.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},removeClass:function(a,b){a.className=a.className.replace(/(\S+)\s*/g,function(a,c){return c===b?"":a}).replace(/^\s+/,"")},setOpacity:function(a,b){L.Browser.ie?a.style.filter="alpha(opacity="+Math.round(b*100)+")":a.style.opacity=b},testProp:function(a){var b=document.documentElement.style;for(var c=0;c=b.lat&&e.lat<=c.lat&&d.lng>=b.lng&&e.lng<=c.lng},intersects:function(a){var b=this._southWest,c=this._northEast,d=a.getSouthWest(),e=a.getNorthEast(),f=e.lat>=b.lat&&d.lat<=c.lat,g=e.lng>=b.lng&&d.lng<=c.lng;return f&&g},toBBoxString:function(){var a=this._southWest,b=this._northEast;return[a.lng,a.lat,b.lng,b.lat].join(",")}}),L.Projection={},L.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=L.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=a.lng*b,f=d*b;return f=Math.log(Math.tan(Math.PI/4+f/2)),new L.Point(e,f)},unproject:function(a,b){var c=L.LatLng.RAD_TO_DEG,d=a.x*c,e=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*c;return new L.LatLng(e,d,b)}},L.Projection.LonLat={project:function(a){return new L.Point(a.lng,a.lat)},unproject:function(a,b){return new L.LatLng(a.y,a.x,b)}},L.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a);return this.transformation._transform(c,b)},pointToLatLng:function(a,b,c){var d=this.transformation.untransform(a,b);return this.projection.unproject(d,c)},project:function(a){return this.projection.project(a)}},L.CRS.EPSG3857=L.Util.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),L.CRS.EPSG900913=L.Util.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"}),L.CRS.EPSG4326=L.Util.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,.5,-1/360,.5)}),L.Map=L.Class.extend({includes:L.Mixin.Events,options:{crs:L.CRS.EPSG3857||L.CRS.EPSG4326,scale:function(a){return 256*Math.pow(2,a)},center:null,zoom:null,layers:[],dragging:!0,touchZoom:L.Browser.touch&&!L.Browser.android,scrollWheelZoom:!L.Browser.touch,doubleClickZoom:!0,boxZoom:!0,zoomControl:!0,attributionControl:!0,fadeAnimation:L.DomUtil.TRANSITION&&!L.Browser.android,zoomAnimation:L.DomUtil.TRANSITION&&!L.Browser.android&&!L.Browser.mobileOpera,trackResize:!0,closePopupOnClick:!0,worldCopyJump:!0},initialize:function(a,b){L.Util.setOptions(this,b),this._container=L.DomUtil.get(a);if(this._container._leaflet)throw Error("Map container is already initialized.");this._container._leaflet=!0,this._initLayout(),L.DomEvent&&(this._initEvents(),L.Handler&&this._initInteraction(),L.Control&&this._initControls()),this.options.maxBounds&&this.setMaxBounds(this.options.maxBounds);var c=this.options.center,d=this.options.zoom;c!==null&&d!==null&&this.setView(c,d,!0);var e=this.options.layers;e=e instanceof Array?e:[e],this._tileLayersNum=0,this._initLayers(e)},setView:function(a,b){return this._resetView(a,this._limitZoom(b)),this},setZoom:function(a){return this.setView(this.getCenter(),a)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(a){var b=this.getBoundsZoom(a);return this.setView(a.getCenter(),b)},fitWorld:function(){var a=new L.LatLng(-60,-170),b=new L.LatLng(85,179);return this.fitBounds(new L.LatLngBounds(a,b))},panTo:function(a){return this.setView(a,this._zoom)},panBy:function(a){return this.fire("movestart"),this._rawPanBy(a),this.fire("move"),this.fire("moveend"),this},setMaxBounds:function(a){this.options.maxBounds=a;if(!a)return this._boundsMinZoom=null,this;var b=this.getBoundsZoom(a,!0);return this._boundsMinZoom=b,this._loaded&&(this._zoomf.x&&(g=f.x-d.x),c.y>e.y&&(h=e.y-c.y),c.xl&&--m>0)o=h*Math.sin(j),n=Math.PI/2-2*Math.atan(i*Math.pow((1-o)/(1+o),.5*h))-j,j+=n;return new L.LatLng(j*c,f,b)}},L.CRS.EPSG3395=L.Util.extend({},L.CRS,{code:"EPSG:3395",projection:L.Projection.Mercator,transformation:function(){var a=L.Projection.Mercator,b=a.R_MAJOR,c=a.R_MINOR;return new L.Transformation(.5/(Math.PI*b),.5,-0.5/(Math.PI*c),.5)}()}),L.TileLayer=L.Class.extend({includes:L.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",opacity:1,scheme:"xyz",continuousWorld:!1,noWrap:!1,zoomOffset:0,zoomReverse:!1,unloadInvisibleTiles:L.Browser.mobile,updateWhenIdle:L.Browser.mobile,reuseTiles:!1},initialize:function(a,b,c){L.Util.setOptions(this,b),this._url=a,this._urlParams=c,typeof this.options.subdomains=="string"&&(this.options.subdomains=this.options.subdomains.split(""))},onAdd:function(a,b){this._map=a,this._insertAtTheBottom=b,this._initContainer(),this._createTileProto(),a.on("viewreset",this._resetCallback,this),this.options.updateWhenIdle?a.on("moveend",this._update,this):(this._limitedUpdate=L.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},onRemove:function(a){this._map.getPanes().tilePane.removeChild(this._container),this._container=null,this._map.off("viewreset",this._resetCallback,this),this.options.updateWhenIdle?this._map.off("moveend",this._update,this):this._map.off("move",this._limitedUpdate,this)},getAttribution:function(){return this.options.attribution},setOpacity:function(a){this.options.opacity=a,this._setOpacity(a);if(L.Browser.webkit)for(var b in this._tiles)this._tiles.hasOwnProperty(b)&&(this._tiles[b].style.webkitTransform+=" translate(0,0)")},_setOpacity:function(a){a<1&&L.DomUtil.setOpacity(this._container,a)},_initContainer:function(){var a=this._map.getPanes().tilePane,b=a.firstChild;if(!this._container||a.empty)this._container=L.DomUtil.create("div","leaflet-layer"),this._insertAtTheBottom&&b?a.insertBefore(this._container,b):a.appendChild(this._container),this._setOpacity(this.options.opacity)},_resetCallback:function(a){this._reset(a.hard)},_reset:function(a){var b;for(b in this._tiles)this._tiles.hasOwnProperty(b)&&this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this.options.reuseTiles&&(this._unusedTiles=[]),a&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){var a=this._map.getPixelBounds(),b=this._map.getZoom(),c=this.options.tileSize;if(b>this.options.maxZoom||ba.max.x||da.max.y)f=this._tiles[e],this.fire("tileunload",{tile:f,url:f.src}),f.parentNode===this._container&&this._container.removeChild(f),this.options.reuseTiles&&this._unusedTiles.push(this._tiles[e]),f.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",delete this._tiles[e]}},_addTile:function(a,b){var c=this._getTilePos(a),d=this._map.getZoom(),e=a.x+":"+a.y,f=Math.pow(2,this._getOffsetZoom(d));if(!this.options.continuousWorld){if(!this.options.noWrap)a.x=(a.x%f+f)%f;else if(a.x<0||a.x>=f){this._tilesToLoad--;return}if(a.y<0||a.y>=f){this._tilesToLoad--;return}}var g=this._getTile();L.DomUtil.setPosition(g,c),this._tiles[e]=g,this.options.scheme==="tms"&&(a.y=f-a.y-1),this._loadTile(g,a,d),b.appendChild(g)},_getOffsetZoom:function(a){return a=this.options.zoomReverse?this.options.maxZoom-a:a,a+this.options.zoomOffset},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this.options.tileSize;return a.multiplyBy(c).subtract(b)},getTileUrl:function(a,b){var c=this.options.subdomains,d=this.options.subdomains[(a.x+a.y)%c.length];return L.Util.template(this._url,L.Util.extend({s:d,z:this._getOffsetZoom(b),x:a.x,y:a.y},this._urlParams))},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile"),this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px",this._tileImg.style.height=a+"px"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(a){},_createTile:function(){var a=this._tileImg.cloneNode(!1);return a.onselectstart=a.onmousemove=L.Util.falseFn,a},_loadTile:function(a,b,c){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,a.src=this.getTileUrl(b,c)},_tileOnLoad:function(a){var b=this._layer;this.className+=" leaflet-tile-loaded",b.fire("tileload",{tile:this,url:this.src}),b._tilesToLoad--,b._tilesToLoad||b.fire("load")},_tileOnError:function(a){var b=this._layer;b.fire("tileerror",{tile:this,url:this.src});var c=b.options.errorTileUrl;c&&(this.src=c)}}),L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a,this.wmsParams=L.Util.extend({},this.defaultWmsParams),this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){var b=parseFloat(this.wmsParams.version)<1.3?"srs":"crs";this.wmsParams[b]=a.options.crs.code,L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a,b){var c=this.options.tileSize,d=a.multiplyBy(c),e=d.add(new L.Point(c,c)),f=this._map.unproject(d,this._zoom,!0),g=this._map.unproject(e,this._zoom,!0),h=this._map.options.crs.project(f),i=this._map.options.crs.project(g),j=[h.x,i.y,i.x,h.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+j}}),L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},redraw:function(){for(var a in this._tiles){var b=this._tiles[a];this._redrawTile(b)}},_redrawTile:function(a){this.drawTile(a,a._tilePoint,a._zoom)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a,this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);return a.onselectstart=a.onmousemove=L.Util.falseFn,a},_loadTile:function(a,b,c){a._layer=this,a._tilePoint=b,a._zoom=c,this.drawTile(a,b,c),this.options.async||this.tileDrawn(a)},drawTile:function(a,b,c){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a,this._bounds=b},onAdd:function(a){this._map=a,this._image||this._initImage(),a.getPanes().overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer"),this._image.style.visibility="hidden",L.Util.extend(this._image,{galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:L.Util.bind(this._onImageLoad,this),src:this._url})},_reset:function(){var a=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()),c=b.subtract(a);L.DomUtil.setPosition(this._image,a),this._image.style.width=c.x+"px",this._image.style.height=c.y+"px"},_onImageLoad:function(){this._image.style.visibility="",this.fire("load")}}),L.Icon=L.Class.extend({iconUrl:L.ROOT_URL+"images/marker.png",shadowUrl:L.ROOT_URL+"images/marker-shadow.png",iconSize:new L.Point(25,41),shadowSize:new L.Point(41,41),iconAnchor:new L.Point(13,41),popupAnchor:new L.Point(0,-33),initialize:function(a){a&&(this.iconUrl=a)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(a){var b=this[a+"Size"],c=this[a+"Url"];if(!c&&a==="shadow")return null;var d;return c?d=this._createImg(c):d=this._createDiv(),d.className="leaflet-marker-"+a,d.style.marginLeft=-this.iconAnchor.x+"px",d.style.marginTop=-this.iconAnchor.y+"px",b&&(d.style.width=b.x+"px",d.style.height=b.y+"px"),d},_createImg:function(a){var b;return L.Browser.ie6?(b=document.createElement("div"),b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'):(b=document.createElement("img"),b.src=a),b},_createDiv:function(){return document.createElement("div")}}),L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon,title:"",clickable:!0,draggable:!1,zIndexOffset:0},initialize:function(a,b){L.Util.setOptions(this,b),this._latlng=a},onAdd:function(a){this._map=a,this._initIcon(),a.on("viewreset",this._reset,this),this._reset()},onRemove:function(a){this._removeIcon(),this.closePopup&&this.closePopup(),this._map=null,a.off("viewreset",this._reset,this)},getLatLng:function(){return this._latlng},setLatLng:function(a){this._latlng=a,this._icon&&(this._reset(),this._popup&&this._popup.setLatLng(this._latlng))},setZIndexOffset:function(a){this.options.zIndexOffset=a,this._icon&&this._reset()},setIcon:function(a){this._map&&this._removeIcon(),this.options.icon=a,this._map&&(this._initIcon(),this._reset())},_initIcon:function(){this._icon||(this._icon=this.options.icon.createIcon(),this.options.title&&(this._icon.title=this.options.title),this._initInteraction()),this._shadow||(this._shadow=this.options.icon.createShadow()),this._map._panes.markerPane.appendChild(this._icon),this._shadow&&this._map._panes.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this._map._panes.markerPane.removeChild(this._icon),this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_reset:function(){var a=this._map.latLngToLayerPoint(this._latlng).round();L.DomUtil.setPosition(this._icon,a),this._shadow&&L.DomUtil.setPosition(this._shadow,a),this._icon.style.zIndex=a.y+this.options.zIndexOffset},_initInteraction:function(){if(this.options.clickable){this._icon.className+=" leaflet-clickable",L.DomEvent.addListener(this._icon,"click",this._onMouseClick,this);var a=["dblclick","mousedown","mouseover","mouseout"];for(var b=0;bthis.options.maxWidth?this.options.maxWidth:af.x&&(d.x=c.x+this._containerWidth-f.x+e.x),c.y<0&&(d.y=c.y-e.y),c.y+a>f.y&&(d.y=c.y+a-f.y+e.y),(d.x||d.y)&&this._map.panBy(d)},_onCloseButtonClick:function(a){this._close(),L.DomEvent.stop(a)}}),L.Marker.include({openPopup:function(){return this._popup.setLatLng(this._latlng),this._map&&this._map.openPopup(this._popup),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(a,b){return b=L.Util.extend({offset:this.options.icon.popupAnchor},b),this._popup||this.on("click",this.openPopup,this),this._popup=new L.Popup(b,this),this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup)),this}}),L.Map.include({openPopup:function(a){return this.closePopup(),this._popup=a,this.addLayer(a),this.fire("popupopen",{popup:this._popup}),this},closePopup:function(){return this._popup&&(this.removeLayer(this._popup),this.fire("popupclose",{popup:this._popup}),this._popup=null),this}}),L.LayerGroup=L.Class.extend({initialize:function(a){this._layers={};if(a)for(var b=0,c=a.length;b')}}catch(a){return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}()},_initPath:function(){this._container=L.Path._createElement("shape"),this._container.className+=" leaflet-vml-shape"+(this.options.clickable?" leaflet-clickable":""),this._container.coordsize="1 1",this._path=L.Path._createElement("path"),this._container.appendChild(this._path),this._map._pathRoot.appendChild(this._container)},_initStyle:function(){this.options.stroke?(this._stroke=L.Path._createElement("stroke"),this._stroke.endcap="round",this._container.appendChild(this._stroke)):this._container.stroked=!1,this.options.fill?(this._container.filled=!0,this._fill=L.Path._createElement("fill"),this._container.appendChild(this._fill)):this._container.filled=!1,this._updateStyle()},_updateStyle:function(){this.options.stroke&&(this._stroke.weight=this.options.weight+"px",this._stroke.color=this.options.color,this._stroke.opacity=this.options.opacity),this.options.fill&&(this._fill.color=this.options.fillColor||this.options.color,this._fill.opacity=this.options.fillOpacity)},_updatePath:function(){this._container.style.display="none",this._path.v=this.getPathString()+" ",this._container.style.display=""}}),L.Map.include(L.Browser.svg||!L.Browser.vml?{}:{_initPathRoot:function(){this._pathRoot||(this._pathRoot=document.createElement("div"),this._pathRoot.className="leaflet-vml-container",this._panes.overlayPane.appendChild(this._pathRoot),this.on("moveend",this._updatePathViewport),this._updatePathViewport())}}),L.Browser.canvas=function(){return!!document.createElement("canvas").getContext}(),L.Path=L.Path.SVG&&!window.L_PREFER_CANVAS||!L.Browser.canvas?L.Path:L.Path.extend({statics:{CANVAS:!0,SVG:!1},options:{updateOnMoveEnd:!0},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){this.options.stroke&&(this._ctx.lineWidth=this.options.weight,this._ctx.strokeStyle=this.options.color),this.options.fill&&(this._ctx.fillStyle=this.options.fillColor||this.options.color)},_drawPath:function(){var a,b,c,d,e,f;this._ctx.beginPath();for(a=0,c=this._parts.length;af&&(g=h,f=i);f>c&&(b[g]=1,this._simplifyDPStep(a,b,c,d,g),this._simplifyDPStep(a,b,c,g,e))},_reducePoints:function(a,b){var c=[a[0]];for(var d=1,e=0,f=a.length;db&&(c.push(a[d]),e=d);return eb.max.x&&(c|=2),a.yb.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var e=b.x,f=b.y,g=c.x-e,h=c.y-f,i=g*g+h*h,j;return i>0&&(j=((a.x-e)*g+(a.y-f)*h)/i,j>1?(e=c.x,f=c.y):j>0&&(e+=g*j,f+=h*j)),g=a.x-e,h=a.y-f,d?g*g+h*h:new L.Point(e,f)}},L.Polyline=L.Path.extend({initialize:function(a,b){L.Path.prototype.initialize.call(this,b),this._latlngs=a},options:{smoothFactor:1,noClip:!1,updateOnMoveEnd:!0},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;aa.max.x||c.y-b>a.max.y||c.x+ba.y!=e.y>a.y&&a.x<(e.x-d.x)*(a.y-d.y)/(e.y-d.y)+d.x&&(b=!b)}return b}}:{}),L.Circle.include(L.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,Math.PI*2)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),L.GeoJSON=L.FeatureGroup.extend({initialize:function(a,b){L.Util.setOptions(this,b),this._geojson=a,this._layers={},a&&this.addGeoJSON(a)},addGeoJSON:function(a){if(a.features){for(var b=0,c=a.features.length;b1)return;var b=a.touches&&a.touches.length===1?a.touches[0]:a,c=b.target;L.DomEvent.preventDefault(a),L.Browser.touch&&c.tagName.toLowerCase()==="a"&&(c.className+=" leaflet-active"),this._moved=!1;if(this._moving)return;L.Browser.touch||(L.DomUtil.disableTextSelection(),this._setMovingCursor()),this._startPos=this._newPos=L.DomUtil.getPosition(this._element),this._startPoint=new L.Point(b.clientX,b.clientY),L.DomEvent.addListener(document,L.Draggable.MOVE,this._onMove,this),L.DomEvent.addListener(document,L.Draggable.END,this._onUp,this)},_onMove:function(a){if(a.touches&&a.touches.length>1)return;L.DomEvent.preventDefault(a);var b=a.touches&&a.touches.length===1?a.touches[0]:a;this._moved||(this.fire("dragstart"),this._moved=!0),this._moving=!0;var c=new L.Point(b.clientX,b.clientY);this._newPos=this._startPos.add(c).subtract(this._startPoint),L.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),L.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(a){if(a.changedTouches){var b=a.changedTouches[0],c=b.target,d=this._newPos&&this._newPos.distanceTo(this._startPos)||0;c.tagName.toLowerCase()==="a"&&(c.className=c.className.replace(" leaflet-active","")),d0&&c<=f,d=b}function l(a){e&&(g.type="dblclick",b(g),d=null)}var d,e=!1,f=250,g,h="_leaflet_",i="touchstart",j="touchend";a[h+i+c]=k,a[h+j+c]=l,a.addEventListener(i,k,!1),a.addEventListener(j,l,!1)},removeDoubleTapListener:function(a,b){var c="_leaflet_";a.removeEventListener(a,a[c+"touchstart"+b],!1),a.removeEventListener(a,a[c+"touchend"+b],!1)}}),L.Map.TouchZoom=L.Handler.extend({addHooks:function(){L.DomEvent.addListener(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){L.DomEvent.removeListener(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){if(!a.touches||a.touches.length!==2||this._map._animatingZoom)return;var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]),d=this._map.containerPointToLayerPoint(this._map.getSize().divideBy(2));this._startCenter=b.add(c).divideBy(2,!0),this._startDist=b.distanceTo(c),this._moved=!1,this._zooming=!0,this._centerOffset=d.subtract(this._startCenter),L.DomEvent.addListener(document,"touchmove",this._onTouchMove,this),L.DomEvent.addListener(document,"touchend",this._onTouchEnd,this),L.DomEvent.preventDefault(a)},_onTouchMove:function(a){if(!a.touches||a.touches.length!==2)return;this._moved||(this._map._mapPane.className+=" leaflet-zoom-anim",this._map.fire("zoomstart").fire("movestart")._prepareTileBg(),this._moved=!0);var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]);this._scale=b.distanceTo(c)/this._startDist,this._delta=b.add(c).divideBy(2,!0).subtract(this._startCenter),this._map._tileBg.style.webkitTransform=[L.DomUtil.getTranslateString(this._delta),L.DomUtil.getScaleString(this._scale,this._startCenter)].join(" "),L.DomEvent.preventDefault(a)},_onTouchEnd:function(a){if(!this._moved||!this._zooming)return;this._zooming=!1;var b=this._map.getZoom(),c=Math.log(this._scale)/Math.LN2,d=c>0?Math.ceil(c):Math.floor(c),e=this._map._limitZoom(b+d),f=e-b,g=this._centerOffset.subtract(this._delta).divideBy(this._scale),h=this._map.getPixelOrigin().add(this._startCenter).add(g),i=this._map.unproject(h);L.DomEvent.removeListener(document,"touchmove",this._onTouchMove),L.DomEvent.removeListener(document,"touchend",this._onTouchEnd);var j=Math.pow(2,f);this._map._runAnimation(i,e,j/this._scale,this._startCenter.add(g))}}),L.Map.BoxZoom=L.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane},addHooks:function(){L.DomEvent.addListener(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){L.DomEvent.removeListener(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;L.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),this._box=L.DomUtil.create("div","leaflet-zoom-box",this._pane),L.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",L.DomEvent.addListener(document,"mousemove",this._onMouseMove,this),L.DomEvent.addListener(document,"mouseup",this._onMouseUp,this),L.DomEvent.preventDefault(a)},_onMouseMove:function(a){var b=this._map.mouseEventToLayerPoint(a),c=b.x-this._startLayerPoint.x,d=b.y-this._startLayerPoint.y,e=Math.min(b.x,this._startLayerPoint.x),f=Math.min(b.y,this._startLayerPoint.y),g=new L.Point(e,f);L.DomUtil.setPosition(this._box,g),this._box.style.width=Math.abs(c)-4+"px",this._box.style.height=Math.abs(d)-4+"px"},_onMouseUp:function(a){this._pane.removeChild(this._box),this._container.style.cursor="",L.DomUtil.enableTextSelection(),L.DomEvent.removeListener(document,"mousemove",this._onMouseMove),L.DomEvent.removeListener(document,"mouseup",this._onMouseUp);var b=this._map.mouseEventToLayerPoint(a),c=new L.LatLngBounds(this._map.layerPointToLatLng(this._startLayerPoint),this._map.layerPointToLatLng(b));this._map.fitBounds(c)}}),L.Handler.MarkerDrag=L.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new L.Draggable(a,a),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(a){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(a){var b=L.DomUtil.getPosition(this._marker._icon);this._marker._shadow&&L.DomUtil.setPosition(this._marker._shadow,b),this._marker._latlng=this._marker._map.layerPointToLatLng(b),this._marker.fire("move").fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),L.Control={},L.Control.Position={TOP_LEFT:"topLeft",TOP_RIGHT:"topRight",BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight"},L.Map.include({addControl:function(a){a.onAdd(this);var b=a.getPosition(),c=this._controlCorners[b],d=a.getContainer();return L.DomUtil.addClass(d,"leaflet-control"),b.indexOf("bottom")!==-1?c.insertBefore(d,c.firstChild):c.appendChild(d),this},removeControl:function(a){var b=a.getPosition(),c=this._controlCorners[b],d=a.getContainer();return c.removeChild(d),a.onRemove&&a.onRemove(this),this},_initControlPos:function(){var a=this._controlCorners={},b="leaflet-",c=b+"top",d=b+"bottom",e=b+"left",f=b+"right",g=L.DomUtil.create("div",b+"control-container",this._container);L.Browser.touch&&(g.className+=" "+b+"big-buttons"),a.topLeft=L.DomUtil.create("div",c+" "+e,g),a.topRight=L.DomUtil.create("div",c+" "+f,g),a.bottomLeft=L.DomUtil.create("div",d+" "+e,g),a.bottomRight=L.DomUtil.create("div",d+" "+f,g)}}),L.Control.Zoom=L.Class.extend({onAdd:function(a){this._map=a,this._container=L.DomUtil.create("div","leaflet-control-zoom"),this._zoomInButton=this._createButton("Zoom in","leaflet-control-zoom-in",this._map.zoomIn,this._map),this._zoomOutButton=this._createButton("Zoom out","leaflet-control-zoom-out",this._map.zoomOut,this._map),this._container.appendChild(this._zoomInButton),this._container.appendChild(this._zoomOutButton)},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_LEFT},_createButton:function(a,b,c,d){var e=document.createElement("a");return e.href="#",e.title=a,e.className=b,L.Browser.touch||L.DomEvent.disableClickPropagation(e),L.DomEvent.addListener(e,"click",L.DomEvent.preventDefault),L.DomEvent.addListener(e,"click",c,d),e}}),L.Control.Attribution=L.Class.extend({initialize:function(a){this._prefix=a||'Powered by Leaflet',this._attributions={}},onAdd:function(a){this._container=L.DomUtil.create("div","leaflet-control-attribution"),L.DomEvent.disableClickPropagation(this._container),this._map=a,this._update()},getPosition:function(){return L.Control.Position.BOTTOM_RIGHT},getContainer:function(){return this._container},setPrefix:function(a){this._prefix=a,this._update()},addAttribution:function(a){if(!a)return;this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update()},removeAttribution:function(a){if(!a)return;this._attributions[a]--,this._update()},_update:function(){if(!this._map)return;var a=[];for(var b in this._attributions)this._attributions.hasOwnProperty(b)&&a.push(b);var c=[];this._prefix&&c.push(this._prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" — ")}}),L.Control.Layers=L.Class.extend({options:{collapsed:!0},initialize:function(a,b,c){L.Util.setOptions(this,c),this._layers={};for(var d in a)a.hasOwnProperty(d)&&this._addLayer(a[d],d);for(d in b)b.hasOwnProperty(d)&&this._addLayer(b[d],d,!0)},onAdd:function(a){this._map=a,this._initLayout(),this._update()},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_RIGHT},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=L.Util.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-control-layers"),L.Browser.touch||L.DomEvent.disableClickPropagation(this._container),this._form=L.DomUtil.create("form","leaflet-control-layers-list");if(this.options.collapsed){L.DomEvent.addListener(this._container,"mouseover",this._expand,this),L.DomEvent.addListener(this._container,"mouseout",this._collapse,this);var a=this._layersLink=L.DomUtil.create("a","leaflet-control-layers-toggle");a.href="#",a.title="Layers",L.Browser.touch?L.DomEvent.addListener(a,"click",this._expand,this):L.DomEvent.addListener(a,"focus",this._expand,this),this._map.on("movestart",this._collapse,this),this._container.appendChild(a)}else this._expand();this._baseLayersList=L.DomUtil.create("div","leaflet-control-layers-base",this._form),this._separator=L.DomUtil.create("div","leaflet-control-layers-separator",this._form),this._overlaysList=L.DomUtil.create("div","leaflet-control-layers-overlays",this._form),this._container.appendChild(this._form)},_addLayer:function(a,b,c){var d=L.Util.stamp(a);this._layers[d]={layer:a,name:b,overlay:c}},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a=!1,b=!1;for(var c in this._layers)if(this._layers.hasOwnProperty(c)){var d=this._layers[c];this._addItem(d),b=b||d.overlay,a=a||!d.overlay}this._separator.style.display=b&&a?"":"none"},_addItem:function(a,b){var c=document.createElement("label"),d=document.createElement("input");a.overlay||(d.name="leaflet-base-layers"),d.type=a.overlay?"checkbox":"radio",d.checked=this._map.hasLayer(a.layer),d.layerId=L.Util.stamp(a.layer),L.DomEvent.addListener(d,"click",this._onInputClick,this);var e=document.createTextNode(" "+a.name);c.appendChild(d),c.appendChild(e);var f=a.overlay?this._overlaysList:this._baseLayersList;f.appendChild(c)},_onInputClick:function(){var a,b,c,d=this._form.getElementsByTagName("input"),e=d.length;for(a=0;a0},removeEventListener:function(a,b,c){if(!this.hasEventListeners(a))return this;for(var d=0,e=this._leaflet_events,f=e[a].length;d=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){var b=this.min,c=this.max,d=a.min,e=a.max,f=e.x>=b.x&&d.x<=c.x,g=e.y>=b.y&&d.y<=c.y;return f&&g}}),L.Transformation=L.Class.extend({initialize:function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new L.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}}),L.DomUtil={get:function(a){return typeof a=="string"?document.getElementById(a):a},getStyle:function(a,b){var c=a.style[b];!c&&a.currentStyle&&(c=a.currentStyle[b]);if(!c||c==="auto"){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}return c==="auto"?null:c},getViewportOffset:function(a){var b=0,c=0,d=a,e=document.body;do{b+=d.offsetTop||0,c+=d.offsetLeft||0;if(d.offsetParent===e&&L.DomUtil.getStyle(d,"position")==="absolute")break;d=d.offsetParent}while(d);d=a;do{if(d===e)break;b-=d.scrollTop||0,c-=d.scrollLeft||0,d=d.parentNode}while(d);return new L.Point(c,b)},create:function(a,b,c){var d=document.createElement(a);return d.className=b,c&&c.appendChild(d),d},disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty(),this._onselectstart||(this._onselectstart=document.onselectstart,document.onselectstart=L.Util.falseFn)},enableTextSelection:function(){document.onselectstart=this._onselectstart,this._onselectstart=null},hasClass:function(a,b){return a.className.length>0&&RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},addClass:function(a,b){L.DomUtil.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},removeClass:function(a,b){a.className=a.className.replace(/(\S+)\s*/g,function(a,c){return c===b?"":a}).replace(/^\s+/,"")},setOpacity:function(a,b){L.Browser.ie?a.style.filter="alpha(opacity="+Math.round(b*100)+")":a.style.opacity=b},testProp:function(a){var b=document.documentElement.style;for(var c=0;c=b.lat&&e.lat<=c.lat&&d.lng>=b.lng&&e.lng<=c.lng},intersects:function(a){var b=this._southWest,c=this._northEast,d=a.getSouthWest(),e=a.getNorthEast(),f=e.lat>=b.lat&&d.lat<=c.lat,g=e.lng>=b.lng&&d.lng<=c.lng;return f&&g},toBBoxString:function(){var a=this._southWest,b=this._northEast;return[a.lng,a.lat,b.lng,b.lat].join(",")}}),L.Projection={},L.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=L.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=a.lng*b,f=d*b;return f=Math.log(Math.tan(Math.PI/4+f/2)),new L.Point(e,f)},unproject:function(a,b){var c=L.LatLng.RAD_TO_DEG,d=a.x*c,e=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*c;return new L.LatLng(e,d,b)}},L.Projection.LonLat={project:function(a){return new L.Point(a.lng,a.lat)},unproject:function(a,b){return new L.LatLng(a.y,a.x,b)}},L.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a);return this.transformation._transform(c,b)},pointToLatLng:function(a,b,c){var d=this.transformation.untransform(a,b);return this.projection.unproject(d,c)},project:function(a){return this.projection.project(a)}},L.CRS.EPSG3857=L.Util.extend({},L.CRS,{code:"EPSG:3857",projection:L.Projection.SphericalMercator,transformation:new L.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),L.CRS.EPSG900913=L.Util.extend({},L.CRS.EPSG3857,{code:"EPSG:900913"}),L.CRS.EPSG4326=L.Util.extend({},L.CRS,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/360,.5,-1/360,.5)}),L.Map=L.Class.extend({includes:L.Mixin.Events,options:{crs:L.CRS.EPSG3857||L.CRS.EPSG4326,scale:function(a){return 256*Math.pow(2,a)},center:null,zoom:null,layers:[],dragging:!0,touchZoom:L.Browser.touch&&!L.Browser.android,scrollWheelZoom:!L.Browser.touch,doubleClickZoom:!0,boxZoom:!0,zoomControl:!0,attributionControl:!0,fadeAnimation:L.DomUtil.TRANSITION&&!L.Browser.android,zoomAnimation:L.DomUtil.TRANSITION&&!L.Browser.android&&!L.Browser.mobileOpera,trackResize:!0,closePopupOnClick:!0,worldCopyJump:!0},initialize:function(a,b){L.Util.setOptions(this,b),this._container=L.DomUtil.get(a);if(this._container._leaflet)throw Error("Map container is already initialized.");this._container._leaflet=!0,this._initLayout(),L.DomEvent&&(this._initEvents(),L.Handler&&this._initInteraction(),L.Control&&this._initControls()),this.options.maxBounds&&this.setMaxBounds(this.options.maxBounds);var c=this.options.center,d=this.options.zoom;c!==null&&d!==null&&this.setView(c,d,!0);var e=this.options.layers;e=e instanceof Array?e:[e],this._tileLayersNum=0,this._initLayers(e)},setView:function(a,b){return this._resetView(a,this._limitZoom(b)),this},setZoom:function(a){return this.setView(this.getCenter(),a)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(a){var b=this.getBoundsZoom(a);return this.setView(a.getCenter(),b)},fitWorld:function(){var a=new L.LatLng(-60,-170),b=new L.LatLng(85,179);return this.fitBounds(new L.LatLngBounds(a,b))},panTo:function(a){return this.setView(a,this._zoom)},panBy:function(a){return this.fire("movestart"),this._rawPanBy(a),this.fire("move"),this.fire("moveend"),this},setMaxBounds:function(a){this.options.maxBounds=a;if(!a)return this._boundsMinZoom=null,this;var b=this.getBoundsZoom(a,!0);return this._boundsMinZoom=b,this._loaded&&(this._zoomf.x&&(g=f.x-d.x),c.y>e.y&&(h=e.y-c.y),c.xl&&--m>0)o=h*Math.sin(j),n=Math.PI/2-2*Math.atan(i*Math.pow((1-o)/(1+o),.5*h))-j,j+=n;return new L.LatLng(j*c,f,b)}},L.CRS.EPSG3395=L.Util.extend({},L.CRS,{code:"EPSG:3395",projection:L.Projection.Mercator,transformation:function(){var a=L.Projection.Mercator,b=a.R_MAJOR,c=a.R_MINOR;return new L.Transformation(.5/(Math.PI*b),.5,-0.5/(Math.PI*c),.5)}()}),L.TileLayer=L.Class.extend({includes:L.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",opacity:1,scheme:"xyz",continuousWorld:!1,noWrap:!1,zoomOffset:0,zoomReverse:!1,unloadInvisibleTiles:L.Browser.mobile,updateWhenIdle:L.Browser.mobile,reuseTiles:!1},initialize:function(a,b,c){L.Util.setOptions(this,b),this._url=a,this._urlParams=c,typeof this.options.subdomains=="string"&&(this.options.subdomains=this.options.subdomains.split(""))},onAdd:function(a,b){this._map=a,this._insertAtTheBottom=b,this._initContainer(),this._createTileProto(),a.on("viewreset",this._resetCallback,this),this.options.updateWhenIdle?a.on("moveend",this._update,this):(this._limitedUpdate=L.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},onRemove:function(a){this._map.getPanes().tilePane.removeChild(this._container),this._container=null,this._map.off("viewreset",this._resetCallback,this),this.options.updateWhenIdle?this._map.off("moveend",this._update,this):this._map.off("move",this._limitedUpdate,this)},getAttribution:function(){return this.options.attribution},setOpacity:function(a){this.options.opacity=a,this._setOpacity(a);if(L.Browser.webkit)for(var b in this._tiles)this._tiles.hasOwnProperty(b)&&(this._tiles[b].style.webkitTransform+=" translate(0,0)")},_setOpacity:function(a){a<1&&L.DomUtil.setOpacity(this._container,a)},_initContainer:function(){var a=this._map.getPanes().tilePane,b=a.firstChild;if(!this._container||a.empty)this._container=L.DomUtil.create("div","leaflet-layer"),this._insertAtTheBottom&&b?a.insertBefore(this._container,b):a.appendChild(this._container),this._setOpacity(this.options.opacity)},_resetCallback:function(a){this._reset(a.hard)},_reset:function(a){var b;for(b in this._tiles)this._tiles.hasOwnProperty(b)&&this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this.options.reuseTiles&&(this._unusedTiles=[]),a&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(){var a=this._map.getPixelBounds(),b=this._map.getZoom(),c=this.options.tileSize;if(b>this.options.maxZoom||ba.max.x||da.max.y)f=this._tiles[e],this.fire("tileunload",{tile:f,url:f.src}),f.parentNode===this._container&&this._container.removeChild(f),this.options.reuseTiles&&this._unusedTiles.push(this._tiles[e]),f.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",delete this._tiles[e]}},_addTile:function(a,b){var c=this._getTilePos(a),d=this._map.getZoom(),e=a.x+":"+a.y,f=Math.pow(2,this._getOffsetZoom(d));if(!this.options.continuousWorld){if(!this.options.noWrap)a.x=(a.x%f+f)%f;else if(a.x<0||a.x>=f){this._tilesToLoad--;return}if(a.y<0||a.y>=f){this._tilesToLoad--;return}}var g=this._getTile();L.DomUtil.setPosition(g,c),this._tiles[e]=g,this.options.scheme==="tms"&&(a.y=f-a.y-1),this._loadTile(g,a,d),b.appendChild(g)},_getOffsetZoom:function(a){return a=this.options.zoomReverse?this.options.maxZoom-a:a,a+this.options.zoomOffset},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this.options.tileSize;return a.multiplyBy(c).subtract(b)},getTileUrl:function(a,b){var c=this.options.subdomains,d=this.options.subdomains[(a.x+a.y)%c.length];return L.Util.template(this._url,L.Util.extend({s:d,z:this._getOffsetZoom(b),x:a.x,y:a.y},this._urlParams))},_createTileProto:function(){this._tileImg=L.DomUtil.create("img","leaflet-tile"),this._tileImg.galleryimg="no";var a=this.options.tileSize;this._tileImg.style.width=a+"px",this._tileImg.style.height=a+"px"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(a){},_createTile:function(){var a=this._tileImg.cloneNode(!1);return a.onselectstart=a.onmousemove=L.Util.falseFn,a},_loadTile:function(a,b,c){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,a.src=this.getTileUrl(b,c)},_tileOnLoad:function(a){var b=this._layer;this.className+=" leaflet-tile-loaded",b.fire("tileload",{tile:this,url:this.src}),b._tilesToLoad--,b._tilesToLoad||b.fire("load")},_tileOnError:function(a){var b=this._layer;b.fire("tileerror",{tile:this,url:this.src});var c=b.options.errorTileUrl;c&&(this.src=c)}}),L.TileLayer.WMS=L.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a,this.wmsParams=L.Util.extend({},this.defaultWmsParams),this.wmsParams.width=this.wmsParams.height=this.options.tileSize;for(var c in b)this.options.hasOwnProperty(c)||(this.wmsParams[c]=b[c]);L.Util.setOptions(this,b)},onAdd:function(a){var b=parseFloat(this.wmsParams.version)<1.3?"srs":"crs";this.wmsParams[b]=a.options.crs.code,L.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a,b){var c=this.options.tileSize,d=a.multiplyBy(c),e=d.add(new L.Point(c,c)),f=this._map.unproject(d,this._zoom,!0),g=this._map.unproject(e,this._zoom,!0),h=this._map.options.crs.project(f),i=this._map.options.crs.project(g),j=[h.x,i.y,i.x,h.y].join(",");return this._url+L.Util.getParamString(this.wmsParams)+"&bbox="+j}}),L.TileLayer.Canvas=L.TileLayer.extend({options:{async:!1},initialize:function(a){L.Util.setOptions(this,a)},redraw:function(){for(var a in this._tiles){var b=this._tiles[a];this._redrawTile(b)}},_redrawTile:function(a){this.drawTile(a,a._tilePoint,a._zoom)},_createTileProto:function(){this._canvasProto=L.DomUtil.create("canvas","leaflet-tile");var a=this.options.tileSize;this._canvasProto.width=a,this._canvasProto.height=a},_createTile:function(){var a=this._canvasProto.cloneNode(!1);return a.onselectstart=a.onmousemove=L.Util.falseFn,a},_loadTile:function(a,b,c){a._layer=this,a._tilePoint=b,a._zoom=c,this.drawTile(a,b,c),this.options.async||this.tileDrawn(a)},drawTile:function(a,b,c){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),L.ImageOverlay=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){this._url=a,this._bounds=b},onAdd:function(a){this._map=a,this._image||this._initImage(),a.getPanes().overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this)},_initImage:function(){this._image=L.DomUtil.create("img","leaflet-image-layer"),this._image.style.visibility="hidden",L.Util.extend(this._image,{galleryimg:"no",onselectstart:L.Util.falseFn,onmousemove:L.Util.falseFn,onload:L.Util.bind(this._onImageLoad,this),src:this._url})},_reset:function(){var a=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),b=this._map.latLngToLayerPoint(this._bounds.getSouthEast()),c=b.subtract(a);L.DomUtil.setPosition(this._image,a),this._image.style.width=c.x+"px",this._image.style.height=c.y+"px"},_onImageLoad:function(){this._image.style.visibility="",this.fire("load")}}),L.Icon=L.Class.extend({iconUrl:L.ROOT_URL+"images/marker.png",shadowUrl:L.ROOT_URL+"images/marker-shadow.png",iconSize:new L.Point(25,41),shadowSize:new L.Point(41,41),iconAnchor:new L.Point(13,41),popupAnchor:new L.Point(0,-33),initialize:function(a){a&&(this.iconUrl=a)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(a){var b=this[a+"Size"],c=this[a+"Url"];if(!c&&a==="shadow")return null;var d;return c?d=this._createImg(c):d=this._createDiv(),d.className="leaflet-marker-"+a,d.style.marginLeft=-this.iconAnchor.x+"px",d.style.marginTop=-this.iconAnchor.y+"px",b&&(d.style.width=b.x+"px",d.style.height=b.y+"px"),d},_createImg:function(a){var b;return L.Browser.ie6?(b=document.createElement("div"),b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")'):(b=document.createElement("img"),b.src=a),b},_createDiv:function(){return document.createElement("div")}}),L.Marker=L.Class.extend({includes:L.Mixin.Events,options:{icon:new L.Icon,title:"",clickable:!0,draggable:!1,zIndexOffset:0},initialize:function(a,b){L.Util.setOptions(this,b),this._latlng=a},onAdd:function(a){this._map=a,this._initIcon(),a.on("viewreset",this._reset,this),this._reset()},onRemove:function(a){this._removeIcon(),this.closePopup&&this.closePopup(),this._map=null,a.off("viewreset",this._reset,this)},getLatLng:function(){return this._latlng},setLatLng:function(a){this._latlng=a,this._icon&&(this._reset(),this._popup&&this._popup.setLatLng(this._latlng))},setZIndexOffset:function(a){this.options.zIndexOffset=a,this._icon&&this._reset()},setIcon:function(a){this._map&&this._removeIcon(),this.options.icon=a,this._map&&(this._initIcon(),this._reset())},_initIcon:function(){this._icon||(this._icon=this.options.icon.createIcon(),this.options.title&&(this._icon.title=this.options.title),this._initInteraction()),this._shadow||(this._shadow=this.options.icon.createShadow()),this._map._panes.markerPane.appendChild(this._icon),this._shadow&&this._map._panes.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this._map._panes.markerPane.removeChild(this._icon),this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_reset:function(){var a=this._map.latLngToLayerPoint(this._latlng).round();L.DomUtil.setPosition(this._icon,a),this._shadow&&L.DomUtil.setPosition(this._shadow,a),this._icon.style.zIndex=a.y+this.options.zIndexOffset},_initInteraction:function(){if(this.options.clickable){this._icon.className+=" leaflet-clickable",L.DomEvent.addListener(this._icon,"click",this._onMouseClick,this);var a=["dblclick","mousedown","mouseover","mouseout"];for(var b=0;bthis.options.maxWidth?this.options.maxWidth:af.x&&(d.x=c.x+this._containerWidth-f.x+e.x),c.y<0&&(d.y=c.y-e.y),c.y+a>f.y&&(d.y=c.y+a-f.y+e.y),(d.x||d.y)&&this._map.panBy(d)},_onCloseButtonClick:function(a){this._close(),L.DomEvent.stop(a)}}),L.Marker.include({openPopup:function(){return this._popup.setLatLng(this._latlng),this._map&&this._map.openPopup(this._popup),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(a,b){return b=L.Util.extend({offset:this.options.icon.popupAnchor},b),this._popup||this.on("click",this.openPopup,this),this._popup=new L.Popup(b,this),this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup)),this}}),L.Map.include({openPopup:function(a){return this.closePopup(),this._popup=a,this.addLayer(a),this.fire("popupopen",{popup:this._popup}),this},closePopup:function(){return this._popup&&(this.removeLayer(this._popup),this.fire("popupclose",{popup:this._popup}),this._popup=null),this}}),L.LayerGroup=L.Class.extend({initialize:function(a){this._layers={};if(a)for(var b=0,c=a.length;b')}}catch(a){return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}()},_initPath:function(){this._container=L.Path._createElement("shape"),this._container.className+=" leaflet-vml-shape"+(this.options.clickable?" leaflet-clickable":""),this._container.coordsize="1 1",this._path=L.Path._createElement("path"),this._container.appendChild(this._path),this._map._pathRoot.appendChild(this._container)},_initStyle:function(){this.options.stroke?(this._stroke=L.Path._createElement("stroke"),this._stroke.endcap="round",this._container.appendChild(this._stroke)):this._container.stroked=!1,this.options.fill?(this._container.filled=!0,this._fill=L.Path._createElement("fill"),this._container.appendChild(this._fill)):this._container.filled=!1,this._updateStyle()},_updateStyle:function(){this.options.stroke&&(this._stroke.weight=this.options.weight+"px",this._stroke.color=this.options.color,this._stroke.opacity=this.options.opacity),this.options.fill&&(this._fill.color=this.options.fillColor||this.options.color,this._fill.opacity=this.options.fillOpacity)},_updatePath:function(){this._container.style.display="none",this._path.v=this.getPathString()+" ",this._container.style.display=""}}),L.Map.include(L.Browser.svg||!L.Browser.vml?{}:{_initPathRoot:function(){this._pathRoot||(this._pathRoot=document.createElement("div"),this._pathRoot.className="leaflet-vml-container",this._panes.overlayPane.appendChild(this._pathRoot),this.on("moveend",this._updatePathViewport),this._updatePathViewport())}}),L.Browser.canvas=function(){return!!document.createElement("canvas").getContext}(),L.Path=L.Path.SVG&&!window.L_PREFER_CANVAS||!L.Browser.canvas?L.Path:L.Path.extend({statics:{CANVAS:!0,SVG:!1},options:{updateOnMoveEnd:!0},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){this.options.stroke&&(this._ctx.lineWidth=this.options.weight,this._ctx.strokeStyle=this.options.color),this.options.fill&&(this._ctx.fillStyle=this.options.fillColor||this.options.color)},_drawPath:function(){var a,b,c,d,e,f;this._ctx.beginPath();for(a=0,c=this._parts.length;af&&(g=h,f=i);f>c&&(b[g]=1,this._simplifyDPStep(a,b,c,d,g),this._simplifyDPStep(a,b,c,g,e))},_reducePoints:function(a,b){var c=[a[0]];for(var d=1,e=0,f=a.length;db&&(c.push(a[d]),e=d);return eb.max.x&&(c|=2),a.yb.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var e=b.x,f=b.y,g=c.x-e,h=c.y-f,i=g*g+h*h,j;return i>0&&(j=((a.x-e)*g+(a.y-f)*h)/i,j>1?(e=c.x,f=c.y):j>0&&(e+=g*j,f+=h*j)),g=a.x-e,h=a.y-f,d?g*g+h*h:new L.Point(e,f)}},L.Polyline=L.Path.extend({initialize:function(a,b){L.Path.prototype.initialize.call(this,b),this._latlngs=a},options:{smoothFactor:1,noClip:!1,updateOnMoveEnd:!0},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;aa.max.x||c.y-b>a.max.y||c.x+ba.y!=e.y>a.y&&a.x<(e.x-d.x)*(a.y-d.y)/(e.y-d.y)+d.x&&(b=!b)}return b}}:{}),L.Circle.include(L.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,Math.PI*2)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),L.GeoJSON=L.FeatureGroup.extend({initialize:function(a,b){L.Util.setOptions(this,b),this._geojson=a,this._layers={},a&&this.addGeoJSON(a)},addGeoJSON:function(a){if(a.features){for(var b=0,c=a.features.length;b1)return;var b=a.touches&&a.touches.length===1?a.touches[0]:a,c=b.target;L.DomEvent.preventDefault(a),L.Browser.touch&&c.tagName.toLowerCase()==="a"&&(c.className+=" leaflet-active"),this._moved=!1;if(this._moving)return;L.Browser.touch||(L.DomUtil.disableTextSelection(),this._setMovingCursor()),this._startPos=this._newPos=L.DomUtil.getPosition(this._element),this._startPoint=new L.Point(b.clientX,b.clientY),L.DomEvent.addListener(document,L.Draggable.MOVE,this._onMove,this),L.DomEvent.addListener(document,L.Draggable.END,this._onUp,this)},_onMove:function(a){if(a.touches&&a.touches.length>1)return;L.DomEvent.preventDefault(a);var b=a.touches&&a.touches.length===1?a.touches[0]:a;this._moved||(this.fire("dragstart"),this._moved=!0),this._moving=!0;var c=new L.Point(b.clientX,b.clientY);this._newPos=this._startPos.add(c).subtract(this._startPoint),L.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),L.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(a){if(a.changedTouches){var b=a.changedTouches[0],c=b.target,d=this._newPos&&this._newPos.distanceTo(this._startPos)||0;c.tagName.toLowerCase()==="a"&&(c.className=c.className.replace(" leaflet-active","")),d0&&c<=f,d=b}function l(a){e&&(g.type="dblclick",b(g),d=null)}var d,e=!1,f=250,g,h="_leaflet_",i="touchstart",j="touchend";a[h+i+c]=k,a[h+j+c]=l,a.addEventListener(i,k,!1),a.addEventListener(j,l,!1)},removeDoubleTapListener:function(a,b){var c="_leaflet_";a.removeEventListener(a,a[c+"touchstart"+b],!1),a.removeEventListener(a,a[c+"touchend"+b],!1)}}),L.Map.TouchZoom=L.Handler.extend({addHooks:function(){L.DomEvent.addListener(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){L.DomEvent.removeListener(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(a){if(!a.touches||a.touches.length!==2||this._map._animatingZoom)return;var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]),d=this._map.containerPointToLayerPoint(this._map.getSize().divideBy(2));this._startCenter=b.add(c).divideBy(2,!0),this._startDist=b.distanceTo(c),this._moved=!1,this._zooming=!0,this._centerOffset=d.subtract(this._startCenter),L.DomEvent.addListener(document,"touchmove",this._onTouchMove,this),L.DomEvent.addListener(document,"touchend",this._onTouchEnd,this),L.DomEvent.preventDefault(a)},_onTouchMove:function(a){if(!a.touches||a.touches.length!==2)return;this._moved||(this._map._mapPane.className+=" leaflet-zoom-anim",this._map.fire("zoomstart").fire("movestart")._prepareTileBg(),this._moved=!0);var b=this._map.mouseEventToLayerPoint(a.touches[0]),c=this._map.mouseEventToLayerPoint(a.touches[1]);this._scale=b.distanceTo(c)/this._startDist,this._delta=b.add(c).divideBy(2,!0).subtract(this._startCenter),this._map._tileBg.style.webkitTransform=[L.DomUtil.getTranslateString(this._delta),L.DomUtil.getScaleString(this._scale,this._startCenter)].join(" "),L.DomEvent.preventDefault(a)},_onTouchEnd:function(a){if(!this._moved||!this._zooming)return;this._zooming=!1;var b=this._map.getZoom(),c=Math.log(this._scale)/Math.LN2,d=c>0?Math.ceil(c):Math.floor(c),e=this._map._limitZoom(b+d),f=e-b,g=this._centerOffset.subtract(this._delta).divideBy(this._scale),h=this._map.getPixelOrigin().add(this._startCenter).add(g),i=this._map.unproject(h);L.DomEvent.removeListener(document,"touchmove",this._onTouchMove),L.DomEvent.removeListener(document,"touchend",this._onTouchEnd);var j=Math.pow(2,f);this._map._runAnimation(i,e,j/this._scale,this._startCenter.add(g))}}),L.Map.BoxZoom=L.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane},addHooks:function(){L.DomEvent.addListener(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){L.DomEvent.removeListener(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(a){if(!a.shiftKey||a.which!==1&&a.button!==1)return!1;L.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),this._box=L.DomUtil.create("div","leaflet-zoom-box",this._pane),L.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",L.DomEvent.addListener(document,"mousemove",this._onMouseMove,this),L.DomEvent.addListener(document,"mouseup",this._onMouseUp,this),L.DomEvent.preventDefault(a)},_onMouseMove:function(a){var b=this._map.mouseEventToLayerPoint(a),c=b.x-this._startLayerPoint.x,d=b.y-this._startLayerPoint.y,e=Math.min(b.x,this._startLayerPoint.x),f=Math.min(b.y,this._startLayerPoint.y),g=new L.Point(e,f);L.DomUtil.setPosition(this._box,g),this._box.style.width=Math.abs(c)-4+"px",this._box.style.height=Math.abs(d)-4+"px"},_onMouseUp:function(a){this._pane.removeChild(this._box),this._container.style.cursor="",L.DomUtil.enableTextSelection(),L.DomEvent.removeListener(document,"mousemove",this._onMouseMove),L.DomEvent.removeListener(document,"mouseup",this._onMouseUp);var b=this._map.mouseEventToLayerPoint(a),c=new L.LatLngBounds(this._map.layerPointToLatLng(this._startLayerPoint),this._map.layerPointToLatLng(b));this._map.fitBounds(c)}}),L.Handler.MarkerDrag=L.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new L.Draggable(a,a),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(a){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(a){var b=L.DomUtil.getPosition(this._marker._icon);this._marker._shadow&&L.DomUtil.setPosition(this._marker._shadow,b),this._marker._latlng=this._marker._map.layerPointToLatLng(b),this._marker.fire("move").fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),L.Control={},L.Control.Position={TOP_LEFT:"topLeft",TOP_RIGHT:"topRight",BOTTOM_LEFT:"bottomLeft",BOTTOM_RIGHT:"bottomRight"},L.Map.include({addControl:function(a){a.onAdd(this);var b=a.getPosition(),c=this._controlCorners[b],d=a.getContainer();return L.DomUtil.addClass(d,"leaflet-control"),b.indexOf("bottom")!==-1?c.insertBefore(d,c.firstChild):c.appendChild(d),this},removeControl:function(a){var b=a.getPosition(),c=this._controlCorners[b],d=a.getContainer();return c.removeChild(d),a.onRemove&&a.onRemove(this),this},_initControlPos:function(){var a=this._controlCorners={},b="leaflet-",c=b+"top",d=b+"bottom",e=b+"left",f=b+"right",g=L.DomUtil.create("div",b+"control-container",this._container);L.Browser.touch&&(g.className+=" "+b+"big-buttons"),a.topLeft=L.DomUtil.create("div",c+" "+e,g),a.topRight=L.DomUtil.create("div",c+" "+f,g),a.bottomLeft=L.DomUtil.create("div",d+" "+e,g),a.bottomRight=L.DomUtil.create("div",d+" "+f,g)}}),L.Control.Zoom=L.Class.extend({onAdd:function(a){this._map=a,this._container=L.DomUtil.create("div","leaflet-control-zoom"),this._zoomInButton=this._createButton("Zoom in","leaflet-control-zoom-in",this._map.zoomIn,this._map),this._zoomOutButton=this._createButton("Zoom out","leaflet-control-zoom-out",this._map.zoomOut,this._map),this._container.appendChild(this._zoomInButton),this._container.appendChild(this._zoomOutButton)},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_LEFT},_createButton:function(a,b,c,d){var e=document.createElement("a");return e.href="#",e.title=a,e.className=b,L.Browser.touch||L.DomEvent.disableClickPropagation(e),L.DomEvent.addListener(e,"click",L.DomEvent.preventDefault),L.DomEvent.addListener(e,"click",c,d),e}}),L.Control.Attribution=L.Class.extend({initialize:function(a){this._prefix=a||'Powered by Leaflet',this._attributions={}},onAdd:function(a){this._container=L.DomUtil.create("div","leaflet-control-attribution"),L.DomEvent.disableClickPropagation(this._container),this._map=a,this._update()},getPosition:function(){return L.Control.Position.BOTTOM_RIGHT},getContainer:function(){return this._container},setPrefix:function(a){this._prefix=a,this._update()},addAttribution:function(a){if(!a)return;this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update()},removeAttribution:function(a){if(!a)return;this._attributions[a]--,this._update()},_update:function(){if(!this._map)return;var a=[];for(var b in this._attributions)if(this._attributions.hasOwnProperty(b)&&this._attributions[b])a.push(b);var c=[];this._prefix&&c.push(this._prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" — ")}}),L.Control.Layers=L.Class.extend({options:{collapsed:!0},initialize:function(a,b,c){L.Util.setOptions(this,c),this._layers={};for(var d in a)a.hasOwnProperty(d)&&this._addLayer(a[d],d);for(d in b)b.hasOwnProperty(d)&&this._addLayer(b[d],d,!0)},onAdd:function(a){this._map=a,this._initLayout(),this._update()},getContainer:function(){return this._container},getPosition:function(){return L.Control.Position.TOP_RIGHT},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=L.Util.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){this._container=L.DomUtil.create("div","leaflet-control-layers"),L.Browser.touch||L.DomEvent.disableClickPropagation(this._container),this._form=L.DomUtil.create("form","leaflet-control-layers-list");if(this.options.collapsed){L.DomEvent.addListener(this._container,"mouseover",this._expand,this),L.DomEvent.addListener(this._container,"mouseout",this._collapse,this);var a=this._layersLink=L.DomUtil.create("a","leaflet-control-layers-toggle");a.href="#",a.title="Layers",L.Browser.touch?L.DomEvent.addListener(a,"click",this._expand,this):L.DomEvent.addListener(a,"focus",this._expand,this),this._map.on("movestart",this._collapse,this),this._container.appendChild(a)}else this._expand();this._baseLayersList=L.DomUtil.create("div","leaflet-control-layers-base",this._form),this._separator=L.DomUtil.create("div","leaflet-control-layers-separator",this._form),this._overlaysList=L.DomUtil.create("div","leaflet-control-layers-overlays",this._form),this._container.appendChild(this._form)},_addLayer:function(a,b,c){var d=L.Util.stamp(a);this._layers[d]={layer:a,name:b,overlay:c}},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a=!1,b=!1;for(var c in this._layers)if(this._layers.hasOwnProperty(c)){var d=this._layers[c];this._addItem(d),b=b||d.overlay,a=a||!d.overlay}this._separator.style.display=b&&a?"":"none"},_addItem:function(a,b){var c=document.createElement("label"),d=document.createElement("input");a.overlay||(d.name="leaflet-base-layers"),d.type=a.overlay?"checkbox":"radio",d.checked=this._map.hasLayer(a.layer),d.layerId=L.Util.stamp(a.layer),L.DomEvent.addListener(d,"click",this._onInputClick,this);var e=document.createTextNode(" "+a.name);c.appendChild(d),c.appendChild(e);var f=a.overlay?this._overlaysList:this._baseLayersList;f.appendChild(c)},_onInputClick:function(){var a,b,c,d=this._form.getElementsByTagName("input"),e=d.length;for(a=0;a Date: Tue, 15 May 2012 10:33:45 +0100 Subject: [PATCH 55/72] added option for Bing Layers (you still have to provide your own API key, though!) --- AUTHORS.md | 3 +- WebContent/OSRM.config.js | 14 +- WebContent/base/OSRM.Map.js | 8 +- WebContent/leaflet/TileLayer.Bing.js | 183 +++++++++++++++++++++++++++ WebContent/main.html | 1 + WebContent/printing/printing.html | 1 + WebContent/printing/printing.js | 4 +- 7 files changed, 209 insertions(+), 5 deletions(-) create mode 100644 WebContent/leaflet/TileLayer.Bing.js diff --git a/AUTHORS.md b/AUTHORS.md index 1aa44a2ae..8d6ac377e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -9,4 +9,5 @@ Moyg Jean-Frederic Zbigniew Czernik Jonas Häggqvist -Sabas \ No newline at end of file +Sabas +Paul Spencer \ No newline at end of file diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5aa3115f6..5e6c452db 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -72,6 +72,18 @@ OSRM.DEFAULTS = { url:'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', attribution:'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade', options:{maxZoom: 18} - } + }, + { + display_name: 'Bing Road', + apikey:'Ag_G9YGvTnWtqqSsQ5S4s44ddrRS7GmC7WO94Vo-NoL_p1TiWdwsYcIDirB3_5q-', + type:"Road", + bing:true, + }, + { + display_name: 'Bing Aerial', + apikey:'Ag_G9YGvTnWtqqSsQ5S4s44ddrRS7GmC7WO94Vo-NoL_p1TiWdwsYcIDirB3_5q-', + type:"Aerial", + bing:true, + } ] }; diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index 89b2a9844..848a71363 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -36,8 +36,12 @@ init: function() { var tile_servers = OSRM.DEFAULTS.TILE_SERVERS; var base_maps = {}; for(var i=0, size=tile_servers.length; i' + + '' + + //'
{copyrights}' + + '{copyrights}' + + '' + + 'Terms of Use', + + initialize: function(/*String*/ apiKey, /*String*/ mapType, /*Object*/ options) { + + this._apiKey = apiKey; + this._mapType = mapType; + + this._loadMetadata(); + + L.Util.setOptions(this, options); + }, + + _loadMetadata: function() { + this._callbackId = "_l_tilelayer_bing_" + (L.TileLayer.Bing._callbackId++); + var that = this; + window[this._callbackId] = function() { + L.TileLayer.Bing.processMetadata.apply(that, arguments); + }; + + var params = { + key: this._apiKey, + jsonp: this._callbackId, + include: 'ImageryProviders' + }, + url = "http://dev.virtualearth.net/REST/v1/Imagery/Metadata/" + + this._mapType + L.Util.getParamString(params), + script = document.createElement("script"); + + script.type = "text/javascript"; + script.src = url; + script.id = this._callbackId; + document.getElementsByTagName("head")[0].appendChild(script); + }, + + _onMetadataLoaded: function() {}, + + onAdd: function(map, insertAtTheBottom) { + if (!this.metadata) { + this._onMetadataLoaded = L.Util.bind(function() { + L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom); + map.on('moveend', this._updateAttribution, this); + this._updateAttribution(); + }, this); + } else { + L.TileLayer.prototype.onAdd.call(this, map, insertAtTheBottom); + map.on('moveend', this._updateAttribution, this); + this._updateAttribution(); + } + }, + + onRemove: function(map) { + if (this._map.attributionControl) { + this._map.attributionControl.removeAttribution(this.attribution); + } + this._map.off('moveend', this._updateAttribution, this); + L.TileLayer.prototype.onRemove.call(this, map); + }, + + getTileUrl: function(xy, z) { + var subdomains = this.options.subdomains, + quadDigits = [], + i = z, + digit, + mask, + quadKey; + // borrowed directly from OpenLayers + for (; i > 0; --i) { + digit = '0'; + mask = 1 << (i - 1); + if ((xy.x & mask) != 0) { + digit++; + } + if ((xy.y & mask) != 0) { + digit++; + digit++; + } + quadDigits.push(digit); + } + + return this._url + .replace('{subdomain}', subdomains[(xy.x + xy.y) % subdomains.length]) + .replace('{quadkey}', quadDigits.join("")); + }, + + _updateAttribution: function() { + if (this._map.attributionControl) { + var metadata = this.metadata; + var res = metadata.resourceSets[0].resources[0]; + var bounds = this._map.getBounds(); + var providers = res.imageryProviders, zoom = this._map.getZoom() + 1, + copyrights = "", provider, i, ii, j, jj, bbox, coverage; + for (i=0,ii=providers.length; i= coverage.zoomMin && coverage.bbox.intersects(bounds)) { + copyrights += provider.attribution + " "; + j = jj; + } + } + } + this._map.attributionControl.removeAttribution(this.attribution); + this._map.attributionControl._attributions = {}; + this._map.attributionControl._update(); + this.attribution = this.attributionTemplate + .replace('{logo}', metadata.brandLogoUri) + .replace('{copyrights}', copyrights); + this._map.attributionControl.addAttribution(this.attribution); + } + } +}); + +L.TileLayer.Bing._callbackId = 0; + +L.TileLayer.Bing.processMetadata = function(metadata) { + if (metadata.authenticationResultCode != 'ValidCredentials') { + throw "Invalid Bing Maps API Key" + } + + if (!metadata.resourceSets.length || !metadata.resourceSets[0].resources.length) { + throw "No resources returned, perhaps " + this._mapType + " is an invalid map type?"; + } + + if (metadata.statusCode != 200) { + throw "Bing Maps API request failed with status code " + metadata.statusCode; + } + + this.metadata = metadata; + var res = metadata.resourceSets[0].resources[0], + providers = res.imageryProviders, + i = 0, + j, + provider, + bbox, + script = document.getElementById(this._callbackId); + + for (; i + diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 388c9a3e2..9ce67d8ae 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -38,6 +38,7 @@ or see http://www.gnu.org/licenses/agpl.txt. + diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index 094867bbd..88f11da3c 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -53,7 +53,9 @@ OSRM.prefetchIcons = function(images_list) { // function to initialize a map in the new window OSRM.drawMap = function(tile_server, bounds) { // setup map - var tile_layer = new L.TileLayer(tile_server.url, tile_server.options); + var tile_layer; + if( tile_server.bing ) tile_layer = new L.TileLayer.Bing(tile_server.apikey, tile_server.type); + else tile_layer = new L.TileLayer(tile_server.url, tile_server.options); OSRM.G.map = new OSRM.MapView("overview-map", { center: new L.LatLng(48.84, 10.10), zoom: 13, From 2ee7ea87cd2ff80cf3a13089575f8b0fc52c656f Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 10:42:05 +0100 Subject: [PATCH 56/72] prevent bug when first route yields a timeout --- WebContent/routing/OSRM.Routing.js | 1 + 1 file changed, 1 insertion(+) diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 9c3bd8ff8..bb5c69ea2 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -33,6 +33,7 @@ OSRM.Routing = { init: function() { OSRM.G.markers = new OSRM.Markers(); OSRM.G.route = new OSRM.Route(); + OSRM.G.response = { via_points:[] }; }, From 34389f978956ca7ee19e93962281ddddd5cf0480 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 11:39:39 +0100 Subject: [PATCH 57/72] added support for new API regarding via_nodes --- WebContent/OSRM.config.js | 3 ++- WebContent/base/OSRM.HistoryRoutes.js | 2 -- WebContent/base/OSRM.Via.js | 10 +++++----- WebContent/routing/OSRM.Routing.js | 5 +---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5e6c452db..c7601a2ae 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,7 +19,8 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', + //HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', + HOST_ROUTING_URL: 'http://i10pc68:5000/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search', diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index 7f11b44da..4d68533b6 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -136,10 +136,8 @@ OSRM.extend( OSRM.HistoryRoute,{ if(positions.length == 0) return route; - route.push( {lat: positions[0].lat, lng: positions[0].lng }); for(var i=0; i nearest_index) { - new_via_index = i; + for(var i=1; i nearest_index) { + new_via_index = i-1; break; } } diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index bb5c69ea2..322ff40e1 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -171,14 +171,11 @@ _updateHints: function(response) { // snap all markers to the received route _snapRoute: function() { - var positions = OSRM.G.route.getPositions(); var markers = OSRM.G.markers.route; var via_points = OSRM.G.response.via_points; - markers[0].setPosition( positions[0] ); - markers[markers.length-1].setPosition( positions[positions.length-1] ); for(var i=0; i Date: Tue, 15 May 2012 13:36:21 +0100 Subject: [PATCH 58/72] different colors for history routes --- WebContent/base/OSRM.HistoryRoutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index 7f11b44da..c87c7be3d 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -29,7 +29,7 @@ OSRM.HistoryRoute = function() { {dashed:false, color:'#000055', opacity:0.25, weight:5}, {dashed:false, color:'#000033', opacity:0.20, weight:5}, {dashed:false, color:'#000011', opacity:0.15, weight:5}, - {dashed:false, color:'#FF0000', opacity:0.50, weight:5} + {dashed:false, color:'#000000', opacity:0.10, weight:5} ]; this._history_length = this._history_styles.length; From 19ae6db3080af8f71b3a34f16ab6f3a4b66ffc8b Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 13:47:36 +0100 Subject: [PATCH 59/72] made timestamp secure against injections --- WebContent/gui/OSRM.MainGUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index 7d5a91ef6..c2b28afb3 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -108,7 +108,7 @@ setDataTimestamp: function(response) { if(!response) return; - OSRM.G.data_timestamp = response.timestamp; + OSRM.G.data_timestamp = response.timestamp.slice(0,25).replace(/<\/?[^>]+(>|$)/g ,""); // discard tags document.getElementById('gui-data-timestamp').innerHTML = OSRM.loc("GUI_DATA_TIMESTAMP")+": " + OSRM.G.data_timestamp; } From dfd5ee9134e5da37d4cd0c7df325f7ff587122f0 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 13:48:24 +0100 Subject: [PATCH 60/72] added via marker numbering --- WebContent/base/OSRM.Markers.js | 8 +- WebContent/base/leaflet/L.MouseMarker.js | 7 ++ WebContent/base/leaflet/L.SwitchableIcon.js | 14 ++- WebContent/main.css | 19 +++ WebContent/printing/printing.css | 127 ++++++++++++-------- WebContent/printing/printing.js | 7 +- WebContent/routing/OSRM.Routing.js | 2 + 7 files changed, 128 insertions(+), 56 deletions(-) diff --git a/WebContent/base/OSRM.Markers.js b/WebContent/base/OSRM.Markers.js index fb202879c..08a87bba1 100644 --- a/WebContent/base/OSRM.Markers.js +++ b/WebContent/base/OSRM.Markers.js @@ -131,5 +131,11 @@ hasTarget: function() { if( this.route[this.route.length-1] && this.route[this.route.length-1].label == OSRM.C.TARGET_LABEL ) return true; return false; +}, + +//relabel all via markers +relabelViaMarkers: function() { + for(var i=1, size=this.route.length-1; i Date: Tue, 15 May 2012 15:10:02 +0100 Subject: [PATCH 61/72] fix to polnish translation --- WebContent/localization/OSRM.Locale.pl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/localization/OSRM.Locale.pl.js b/WebContent/localization/OSRM.Locale.pl.js index 66c2eda71..3e6463778 100644 --- a/WebContent/localization/OSRM.Locale.pl.js +++ b/WebContent/localization/OSRM.Locale.pl.js @@ -77,7 +77,7 @@ OSRM.Localization["pl"] = { // %d: direction // [*]: will only be printed when there actually is a road name "DIRECTION_0":"Nieznana instrukcja[ na %s]", -"DIRECTION_1":"Podążaj[ drogą %s]", +"DIRECTION_1":"Kontynuuj[ drogą %s]", "DIRECTION_2":"Skręć lekko w prawo[ na drogę %s]", "DIRECTION_3":"Skręć w prawo[ na drogę %s]", "DIRECTION_4":"Skręć ostro w prawo[ na drogę %s]", @@ -85,7 +85,7 @@ OSRM.Localization["pl"] = { "DIRECTION_6":"Skręć lekko w lewo[ na drogę %s]", "DIRECTION_7":"Skręć w lewo[ na drogę %s]", "DIRECTION_8":"Skręć ostro w lewo[ na drogę %s]", -"DIRECTION_10":"Podążaj %d[ drogą %s]", +"DIRECTION_10":"Podążaj na %d[ drogą %s]", "DIRECTION_11-1":"Wjedź na rondo, zjedź pierwszym zjazdem[ na drogę %s]", "DIRECTION_11-2":"Wjedź na rondo, zjedź drugim zjazdem[ na drogę %s]", "DIRECTION_11-3":"Wjedź na rondo, zjedź trzecim zjazdem[ na drogę %s]", From b85849b6bdd8db8473a7e4cf2192fe536701b10d Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 15:10:24 +0100 Subject: [PATCH 62/72] fix to timeoutRoute call --- WebContent/routing/OSRM.Routing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/routing/OSRM.Routing.js b/WebContent/routing/OSRM.Routing.js index 1ae30e280..71587d3e0 100644 --- a/WebContent/routing/OSRM.Routing.js +++ b/WebContent/routing/OSRM.Routing.js @@ -52,7 +52,7 @@ timeoutRoute_Dragging: function() { }, timeoutRoute_Reversed: function() { OSRM.G.markers.reverseMarkers(); - timeoutRoute(); + OSRM.Routing.timeoutRoute(); }, showRoute: function(response) { if(!response) From 8d40bc7f4fa29a178053e031a304bddef3de0a99 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 16:24:10 +0100 Subject: [PATCH 63/72] added option to query current layer --- .../base/leaflet/L.Control.QueryableLayers.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WebContent/base/leaflet/L.Control.QueryableLayers.js b/WebContent/base/leaflet/L.Control.QueryableLayers.js index 973884591..47c1423ae 100644 --- a/WebContent/base/leaflet/L.Control.QueryableLayers.js +++ b/WebContent/base/leaflet/L.Control.QueryableLayers.js @@ -30,5 +30,18 @@ getActiveLayerName: function () { return obj.name; } } +}, +getActiveLayer: function () { + var i, input, obj, + inputs = this._form.getElementsByTagName('input'), + inputsLen = inputs.length; + + for (i = 0; i < inputsLen; i++) { + input = inputs[i]; + obj = this._layers[input.layerId]; + if (input.checked && !obj.overlay) { + return obj.layer; + } + } } }); From ba0064af99759fe8d1a84835b7f42abb2514fec3 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 15 May 2012 17:19:09 +0100 Subject: [PATCH 64/72] prepared for bing language specific maps --- WebContent/OSRM.config.js | 18 +++++++++--------- WebContent/leaflet/TileLayer.Bing.js | 4 +++- WebContent/localization/OSRM.Localization.js | 10 ++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 5e6c452db..4f21e636d 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -43,13 +43,13 @@ OSRM.DEFAULTS = { LANGUAGE: "en", LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ - {encoding:"en", name:"English"}, - {encoding:"de", name:"Deutsch"}, - {encoding:"dk", name:"Dansk"}, - {encoding:"fi", name:"Suomi"}, - {encoding:"fr", name:"Français"}, - {encoding:"it", name:"Italiano"}, - {encoding:"pl", name:"Polski"} + {encoding:"en", name:"English", culture:"en-US"}, + {encoding:"de", name:"Deutsch", culture:"de-DE"}, + {encoding:"dk", name:"Dansk", culture:"en-US"}, + {encoding:"fi", name:"Suomi", culture:"en-US"}, + {encoding:"fr", name:"Français", culture:"fr-FR"}, + {encoding:"it", name:"Italiano", culture:"it-IT"}, + {encoding:"pl", name:"Polski", culture:"en-US"} ], TILE_SERVERS: [ @@ -75,13 +75,13 @@ OSRM.DEFAULTS = { }, { display_name: 'Bing Road', - apikey:'Ag_G9YGvTnWtqqSsQ5S4s44ddrRS7GmC7WO94Vo-NoL_p1TiWdwsYcIDirB3_5q-', + apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', type:"Road", bing:true, }, { display_name: 'Bing Aerial', - apikey:'Ag_G9YGvTnWtqqSsQ5S4s44ddrRS7GmC7WO94Vo-NoL_p1TiWdwsYcIDirB3_5q-', + apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', type:"Aerial", bing:true, } diff --git a/WebContent/leaflet/TileLayer.Bing.js b/WebContent/leaflet/TileLayer.Bing.js index 229e87ade..c5eba1e36 100644 --- a/WebContent/leaflet/TileLayer.Bing.js +++ b/WebContent/leaflet/TileLayer.Bing.js @@ -110,6 +110,8 @@ L.TileLayer.Bing = L.TileLayer.extend({ } return this._url + //.replace('{culture}', OSRM.Localization.current_culture) + .replace('{culture}', "en-US") .replace('{subdomain}', subdomains[(xy.x + xy.y) % subdomains.length]) .replace('{quadkey}', quadDigits.join("")); }, @@ -174,7 +176,7 @@ L.TileLayer.Bing.processMetadata = function(metadata) { } } - this._url = res.imageUrl.replace('{culture}','en-US'); + this._url = res.imageUrl; this.options.subdomains = [].concat(res.imageUrlSubdomains); script.parentNode.removeChild(script); window[this._callbackId] = undefined; // cannot delete from window in IE diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index f65ce350a..69ff58aff 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -52,11 +52,21 @@ setLanguage: function(language) { // change value of both language selectors OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language ); OSRM.GUI.selectorChange( document.getElementById('gui-language-2-toggle'), language ); +// // change culture value +// OSRM.Localization.current_culture = language+"-"+language; +// var supported_languages = OSRM.DEFAULTS.LANGUAGE_SUPPORTED; +// for(var i=0, size=supported_languages.length; i Date: Tue, 15 May 2012 21:03:58 +0200 Subject: [PATCH 65/72] completed language-dependent bing maps --- WebContent/OSRM.config.js | 18 ++++++++++-------- WebContent/base/OSRM.Map.js | 2 +- .../leaflet/L.TileLayer.Bing.js} | 10 ++++++++-- WebContent/localization/OSRM.Localization.js | 13 +++---------- WebContent/main.html | 2 +- WebContent/printing/OSRM.Printing.js | 1 + WebContent/printing/printing.html | 2 +- WebContent/printing/printing.js | 3 ++- 8 files changed, 27 insertions(+), 24 deletions(-) rename WebContent/{leaflet/TileLayer.Bing.js => base/leaflet/L.TileLayer.Bing.js} (95%) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 4f21e636d..2aff5eaba 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -43,12 +43,12 @@ OSRM.DEFAULTS = { LANGUAGE: "en", LANUGAGE_ONDEMAND_RELOADING: true, LANGUAGE_SUPPORTED: [ - {encoding:"en", name:"English", culture:"en-US"}, - {encoding:"de", name:"Deutsch", culture:"de-DE"}, - {encoding:"dk", name:"Dansk", culture:"en-US"}, - {encoding:"fi", name:"Suomi", culture:"en-US"}, - {encoding:"fr", name:"Français", culture:"fr-FR"}, - {encoding:"it", name:"Italiano", culture:"it-IT"}, + {encoding:"en", name:"English"}, + {encoding:"de", name:"Deutsch"}, + {encoding:"dk", name:"Dansk"}, + {encoding:"fi", name:"Suomi"}, + {encoding:"fr", name:"Français"}, + {encoding:"it", name:"Italiano"}, {encoding:"pl", name:"Polski", culture:"en-US"} ], @@ -75,14 +75,16 @@ OSRM.DEFAULTS = { }, { display_name: 'Bing Road', - apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', + apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx) type:"Road", + options:{minZoom: 1}, bing:true, }, { display_name: 'Bing Aerial', - apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', + apikey:'AjCb2f6Azv_xt9c6pl_xok96bgAYrXQNctnG4o07sTj4iS9N68Za4B3pRJyeCjGr', // please use your own apikey (http://msdn.microsoft.com/en-us/library/ff428642.aspx) type:"Aerial", + options:{minZoom: 1}, bing:true, } ] diff --git a/WebContent/base/OSRM.Map.js b/WebContent/base/OSRM.Map.js index 848a71363..414f8a01a 100644 --- a/WebContent/base/OSRM.Map.js +++ b/WebContent/base/OSRM.Map.js @@ -37,7 +37,7 @@ init: function() { var base_maps = {}; for(var i=0, size=tile_servers.length; i' + 'Terms of Use', + + supportedCultures: {"en":"en-US", "de":"de-DE", "fr":"fr-FR", "it":"it-IT", "es":"es-ES", "nl":"nl-BE"}, initialize: function(/*String*/ apiKey, /*String*/ mapType, /*Object*/ options) { @@ -42,6 +44,11 @@ L.TileLayer.Bing = L.TileLayer.extend({ L.Util.setOptions(this, options); }, + redraw: function() { + this._reset(); + this._update(); + }, + _loadMetadata: function() { this._callbackId = "_l_tilelayer_bing_" + (L.TileLayer.Bing._callbackId++); var that = this; @@ -110,8 +117,7 @@ L.TileLayer.Bing = L.TileLayer.extend({ } return this._url - //.replace('{culture}', OSRM.Localization.current_culture) - .replace('{culture}', "en-US") + .replace('{culture}', this.supportedCultures[OSRM.Localization.current_language] || "en-US" ) .replace('{subdomain}', subdomains[(xy.x + xy.y) % subdomains.length]) .replace('{quadkey}', quadDigits.join("")); }, diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 69ff58aff..25bc56901 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -52,21 +52,14 @@ setLanguage: function(language) { // change value of both language selectors OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language ); OSRM.GUI.selectorChange( document.getElementById('gui-language-2-toggle'), language ); -// // change culture value -// OSRM.Localization.current_culture = language+"-"+language; -// var supported_languages = OSRM.DEFAULTS.LANGUAGE_SUPPORTED; -// for(var i=0, size=supported_languages.length; i - + diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index 5787b1f19..081f1b8bf 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -231,6 +231,7 @@ printWindowLoaded: function(){ } // localization + print_window.OSRM.Localization.current_language = OSRM.Localization.current_language; print_document.getElementById('description-label').innerHTML = OSRM.loc( "ROUTE_DESCRIPTION" ); print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" ); if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) { // error message if no route available (can trigger if user refreshes print-window) diff --git a/WebContent/printing/printing.html b/WebContent/printing/printing.html index 9ce67d8ae..b22418c94 100644 --- a/WebContent/printing/printing.html +++ b/WebContent/printing/printing.html @@ -38,10 +38,10 @@ or see http://www.gnu.org/licenses/agpl.txt. - + diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index 1480a8efc..93d549a30 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -20,6 +20,7 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM = {}; OSRM.GLOBALS = { main_handle:{boxVisible:function(){return false;}} }; // needed for fitBoundsUI to work +OSRM.Localization = { current_language:"en"}; // needed for localized map tiles OSRM.G = OSRM.GLOBALS; @@ -54,7 +55,7 @@ OSRM.prefetchIcons = function(images_list) { OSRM.drawMap = function(tile_server, bounds) { // setup map var tile_layer; - if( tile_server.bing ) tile_layer = new L.TileLayer.Bing(tile_server.apikey, tile_server.type); + if( tile_server.bing ) tile_layer = new L.TileLayer.Bing(tile_server.apikey, tile_server.type, tile_server.options); else tile_layer = new L.TileLayer(tile_server.url, tile_server.options); OSRM.G.map = new OSRM.MapView("overview-map", { center: new L.LatLng(48.84, 10.10), From 6665207066684abcfb2c5ec60f689efa538b4c72 Mon Sep 17 00:00:00 2001 From: shiin Date: Tue, 15 May 2012 23:02:19 +0200 Subject: [PATCH 66/72] added basic maintenance message --- WebContent/OSRM.config.js | 1 + WebContent/main.css | 30 ++++++++++++++++++++++++++++++ WebContent/main.html | 25 +++++++++++++++++++++++++ WebContent/main.js | 14 ++++++++++++++ 4 files changed, 70 insertions(+) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 2aff5eaba..22cbeae83 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,6 +19,7 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { + MAINTENANCE: true, HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', diff --git a/WebContent/main.css b/WebContent/main.css index e7ec3aed2..14f2317af 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -425,6 +425,32 @@ html, body { width:390px; height:80px; } +#notification-wrapper +{ + width:600px; + height:170px; + top: 50%; + left: 50%; + margin-top:-85px; + margin-left:-300px; +} +#notification-content +{ + width:580px; + height:150px; +} +#notification-blanket +{ + position:absolute; + top:0px; + left:0px; + width:100%; + height:100%; + background-color:#666666; + background-color:rgba(0, 0, 0, 0.25); + z-index:100; + display:none; +} /* styles for content of other gui boxes */ @@ -458,6 +484,10 @@ html, body { { float: right; } +#notification-box +{ + margin:5px 5px 5px 5px; +} /* ------------------------------------------------------------------------ */ diff --git a/WebContent/main.html b/WebContent/main.html index 11fc63f4b..ef75ec919 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -86,6 +86,31 @@ or see http://www.gnu.org/licenses/agpl.txt.
+ +
+
+
+ +
+
Scheduled Maintenance
+ + +
+ The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. + The site will be back online shortly. +
+
+ In the meantime you may want to go out an map a friendly neighborhood near you... +
+
+
+
+ [OSRM] +
+
+
+
+
diff --git a/WebContent/main.js b/WebContent/main.js index 129d1de04..e2b75e1f8 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -31,6 +31,10 @@ OSRM.init = function() { OSRM.Printing.init(); OSRM.Routing.init(); + // stop if in maintenance mode + if( OSRM.inMaintenance() == true ) + return; + // check if the URL contains some GET parameter, e.g. for showing a route OSRM.parseParameters(); @@ -263,5 +267,15 @@ OSRM.parseParameters = function(){ }; +// check whether to activate maintenance mode +OSRM.inMaintenance = function(){ + if( OSRM.DEFAULTS.MAINTENANCE == true ) { + document.getElementById('notification-blanket').style.display = "block"; + document.getElementById('notification-toggle').style.display = "none"; + return true; + } + return false; +}; + // onload event OSRM.Browser.onLoadHandler( OSRM.init ); \ No newline at end of file From df623df3e9ce8e3395d9b063dcd4a68fbd569114 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 07:34:04 +0100 Subject: [PATCH 67/72] compatibility --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0b40dea4e..fa92f94b8 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,14 @@ To successfully work a repository that contains submodules, use the following gi Note that the frontend can also be checked out independently of the Project-OSRM repository. +Compatibility +------------- +The frontend has been tested with Firefox 3.0+, Internet Explorer 8+ and Chrome 18+. +Certain visuals like rounded corners or moving boxes will only show in newer browser versions. +But no actual functionality is affected by this. +Note that the frontend will not work with Internet Explorer 6 or 7. + + References ---------- [(1)] Cloudmade Leaflet: http://leaflet.cloudmade.com/ From f6744f9aa16d639242ecd9aa14f26ba6aaa2cbf3 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 07:41:36 +0100 Subject: [PATCH 68/72] corrected jsonp call to fetch timestamp --- WebContent/gui/OSRM.MainGUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/gui/OSRM.MainGUI.js b/WebContent/gui/OSRM.MainGUI.js index c2b28afb3..b77e6e838 100644 --- a/WebContent/gui/OSRM.MainGUI.js +++ b/WebContent/gui/OSRM.MainGUI.js @@ -46,7 +46,7 @@ init: function() { // query last update of data OSRM.G.data_timestamp = "n/a"; - OSRM.JSONP.call('OSRM.DEFAULTS.HOST_TIMESTAMP_URL', OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); + OSRM.JSONP.call(OSRM.DEFAULTS.HOST_TIMESTAMP_URL+"?jsonp=%jsonp", OSRM.GUI.setDataTimestamp, OSRM.JSONP.empty, OSRM.DEFAULTS.JSONP_TIMEOUT, 'data_timestamp'); }, // set language dependent labels From 86772184044befba01affae44dabfdc11dfb7e5c Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 10:07:21 +0100 Subject: [PATCH 69/72] transparancy for IE8 --- WebContent/main.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebContent/main.css b/WebContent/main.css index 14f2317af..f75f6a6c9 100644 --- a/WebContent/main.css +++ b/WebContent/main.css @@ -59,8 +59,8 @@ html, body { border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; - background-color:#666666; background-color:rgba(0, 0, 0, 0.25); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3f000000, endColorstr=#3f000000); } .box-animated { @@ -446,8 +446,8 @@ html, body { left:0px; width:100%; height:100%; - background-color:#666666; background-color:rgba(0, 0, 0, 0.25); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3f000000, endColorstr=#3f000000); z-index:100; display:none; } From cd68e21b95487767622f371f4700d948e216129d Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 10:08:10 +0100 Subject: [PATCH 70/72] moved maintenance message to config file --- WebContent/OSRM.config.js | 9 ++++++--- WebContent/main.html | 15 ++------------- WebContent/main.js | 4 +++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 22cbeae83..282f55d96 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,7 +19,6 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - MAINTENANCE: true, HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', @@ -88,5 +87,9 @@ OSRM.DEFAULTS = { options:{minZoom: 1}, bing:true, } - ] -}; + ], + + MAINTENANCE: true, + MAINTENANCE_HEADER: "Scheduled Maintenance", + MAINTENANCE_TEXT: "The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. The site will be back online shortly.

In the meantime you may want to go out an map a friendly neighborhood near you...


[OSRM]", +}; \ No newline at end of file diff --git a/WebContent/main.html b/WebContent/main.html index ef75ec919..e913562f7 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -92,21 +92,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
Scheduled Maintenance
+
Notification
-
- The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. - The site will be back online shortly. -
-
- In the meantime you may want to go out an map a friendly neighborhood near you... -
-
-
-
- [OSRM] -
+
diff --git a/WebContent/main.js b/WebContent/main.js index e2b75e1f8..94f69826d 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -26,10 +26,10 @@ OSRM.init = function() { OSRM.prefetchCSSIcons(); OSRM.GUI.init(); - OSRM.Localization.init(); OSRM.Map.init(); OSRM.Printing.init(); OSRM.Routing.init(); + OSRM.Localization.init(); // stop if in maintenance mode if( OSRM.inMaintenance() == true ) @@ -271,6 +271,8 @@ OSRM.parseParameters = function(){ OSRM.inMaintenance = function(){ if( OSRM.DEFAULTS.MAINTENANCE == true ) { document.getElementById('notification-blanket').style.display = "block"; + document.getElementById('notification-label').innerHTML = OSRM.DEFAULTS.MAINTENANCE_HEADER; + document.getElementById('notification-box').innerHTML = OSRM.DEFAULTS.MAINTENANCE_TEXT; document.getElementById('notification-toggle').style.display = "none"; return true; } From 2fbfdc93b11625f7eb8ff983b12a01ad2c4722d8 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 10:27:25 +0100 Subject: [PATCH 71/72] moved maintenance message to config file --- WebContent/OSRM.config.js | 9 ++++++--- WebContent/main.html | 15 ++------------- WebContent/main.js | 4 +++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index 22cbeae83..e656e9e21 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,7 +19,6 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - MAINTENANCE: true, HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', @@ -88,5 +87,9 @@ OSRM.DEFAULTS = { options:{minZoom: 1}, bing:true, } - ] -}; + ], + + MAINTENANCE: false, + MAINTENANCE_HEADER: "Scheduled Maintenance", + MAINTENANCE_TEXT: "The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. The site will be back online shortly.

In the meantime you may want to go out an map a friendly neighborhood near you...


[OSRM]", +}; \ No newline at end of file diff --git a/WebContent/main.html b/WebContent/main.html index ef75ec919..e913562f7 100644 --- a/WebContent/main.html +++ b/WebContent/main.html @@ -92,21 +92,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
-
Scheduled Maintenance
+
Notification
-
- The OSRM Website is down for a scheduled maintenance. Please be patient while required updates are performed. - The site will be back online shortly. -
-
- In the meantime you may want to go out an map a friendly neighborhood near you... -
-
-
-
- [OSRM] -
+
diff --git a/WebContent/main.js b/WebContent/main.js index e2b75e1f8..94f69826d 100644 --- a/WebContent/main.js +++ b/WebContent/main.js @@ -26,10 +26,10 @@ OSRM.init = function() { OSRM.prefetchCSSIcons(); OSRM.GUI.init(); - OSRM.Localization.init(); OSRM.Map.init(); OSRM.Printing.init(); OSRM.Routing.init(); + OSRM.Localization.init(); // stop if in maintenance mode if( OSRM.inMaintenance() == true ) @@ -271,6 +271,8 @@ OSRM.parseParameters = function(){ OSRM.inMaintenance = function(){ if( OSRM.DEFAULTS.MAINTENANCE == true ) { document.getElementById('notification-blanket').style.display = "block"; + document.getElementById('notification-label').innerHTML = OSRM.DEFAULTS.MAINTENANCE_HEADER; + document.getElementById('notification-box').innerHTML = OSRM.DEFAULTS.MAINTENANCE_TEXT; document.getElementById('notification-toggle').style.display = "none"; return true; } From 3bce384f9b6c6b139776851c8864bb1680b72677 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Wed, 16 May 2012 12:31:57 +0100 Subject: [PATCH 72/72] changed test server to work server --- WebContent/OSRM.config.js | 3 +-- WebContent/base/OSRM.HistoryRoutes.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WebContent/OSRM.config.js b/WebContent/OSRM.config.js index dac56d84c..7c817671b 100644 --- a/WebContent/OSRM.config.js +++ b/WebContent/OSRM.config.js @@ -19,8 +19,7 @@ or see http://www.gnu.org/licenses/agpl.txt. // [has to be loaded directly after OSRM.base] OSRM.DEFAULTS = { - //HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', - HOST_ROUTING_URL: 'http://i10pc68:5000/viaroute', + HOST_ROUTING_URL: 'http://router.project-osrm.org/viaroute', HOST_SHORTENER_URL: 'http://map.project-osrm.org/shorten/', HOST_TIMESTAMP_URL: 'http://router.project-osrm.org/timestamp', HOST_GEOCODER_URL: 'http://nominatim.openstreetmap.org/search', diff --git a/WebContent/base/OSRM.HistoryRoutes.js b/WebContent/base/OSRM.HistoryRoutes.js index 3507b3b40..7a0a65a77 100644 --- a/WebContent/base/OSRM.HistoryRoutes.js +++ b/WebContent/base/OSRM.HistoryRoutes.js @@ -190,4 +190,4 @@ OSRM.extend( OSRM.HistoryRoute,{ for(var i=0; i
'; - body += '
'; + var pos = positions[response.route_instructions[i][3]]; + body += '
'; // build route description if( response.route_instructions[i][1] != "" ) From a975dba9754d9d23dddf0860dd5f41c814668230 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 8 May 2012 15:57:25 +0100 Subject: [PATCH 19/72] first steps to make printing work with IE8 --- WebContent/printing/OSRM.Printing.js | 100 ++++++++++++++++++--------- WebContent/printing/printing.css | 2 +- WebContent/printing/printing.html | 1 + WebContent/printing/printing.js | 7 +- 4 files changed, 74 insertions(+), 36 deletions(-) diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index 5907af799..e6e313fa1 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -61,44 +61,81 @@ deactivate: function() { // use hide route as trigger // create UI in printwindow show: function(response) { - // create header + // create header (using tables for compatibility with IE quirks mode) var header = '
' + - '
' + - '
' + + '' + + '' + - '
' + - '
' + - '
' + - '
' + OSRM.loc("GUI_START")+ ':
' + - '
' + document.getElementById("gui-input-source").value + '
' + - '
' + - '
' + - '
' + OSRM.loc("GUI_END")+ ':
' + - '
' + document.getElementById("gui-input-target").value + '
' + - '
' + - '
' + - '
' + + '' + - '
' + - '
' + - '
' + - '
' + OSRM.loc("DISTANCE")+':
' + - '
' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + - '
' + - '
' + - '
' + OSRM.loc("DURATION")+':
' + - '
' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + - '
' + - '
' + - '
' + + '' + - '' + - '' + + '' + + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + OSRM.loc("GUI_START")+ ': ' + document.getElementById("gui-input-source").value + '
' + OSRM.loc("GUI_END")+ ': ' + document.getElementById("gui-input-target").value + '
' + + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + OSRM.loc("DISTANCE")+': ' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + OSRM.loc("DURATION")+': ' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + + '
' + '
' + '
' + +// +// '
' + +// '
' + +// +// '
' + +// '
' + +// '
' + +// '
' + OSRM.loc("GUI_START")+ ':
' + +// '
' + document.getElementById("gui-input-source").value + '
' + +// '
' + +// '
' + +// '
' + OSRM.loc("GUI_END")+ ':
' + +// '
' + document.getElementById("gui-input-target").value + '
' + +// '
' + +// '
' + +// '
' + +// +// '
' + +// '
' + +// '
' + +// '
' + OSRM.loc("DISTANCE")+':
' + +// '
' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + +// '
' + +// '
' + +// '
' + OSRM.loc("DURATION")+':
' + +// '
' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + +// '
' + +// '
' + +// '
' + +// +// '
' + +// '
' + +// +// '
' + +// '
'; - if( i != response.route_instructions.length-1 ) - body += ''+OSRM.Utils.toHumanDistance(response.route_instructions[i][2])+''; + body += (i == response.route_instructions.length-1) ? ' ' : ''+OSRM.Utils.toHumanDistance(response.route_instructions[i][2])+''; // fill last entry with a space body += "
' + '' + @@ -98,44 +100,46 @@ show: function(response) { '
' + '
' + - '
' + -// -// '
' + -// '
' + -// -// '
' + -// '
' + -// '
' + -// '
' + OSRM.loc("GUI_START")+ ':
' + -// '
' + document.getElementById("gui-input-source").value + '
' + -// '
' + -// '
' + -// '
' + OSRM.loc("GUI_END")+ ':
' + -// '
' + document.getElementById("gui-input-target").value + '
' + -// '
' + -// '
' + -// '
' + -// -// '
' + -// '
' + -// '
' + -// '
' + OSRM.loc("DISTANCE")+':
' + -// '
' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + -// '
' + -// '
' + -// '
' + OSRM.loc("DURATION")+':
' + -// '
' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + -// '
' + -// '
' + -// '
' + -// -// '
' + -// '
' + -// -// '
' + -// '
' + + + '
' + + '
' + + + '
' + + '
' + + '
' + + '
' + OSRM.loc("GUI_START")+ ':
' + + '
' + document.getElementById("gui-input-source").value + '
' + + '
' + + '
' + + '
' + OSRM.loc("GUI_END")+ ':
' + + '
' + document.getElementById("gui-input-target").value + '
' + + '
' + + '
' + + '
' + + + '
' + + '
' + + '
' + + '
' + OSRM.loc("DISTANCE")+':
' + + '
' + OSRM.Utils.toHumanDistance(response.route_summary.total_distance) + '
' + + '
' + + '
' + + '
' + OSRM.loc("DURATION")+':
' + + '
' + OSRM.Utils.toHumanTime(response.route_summary.total_time) + '
' + + '
' + + '
' + + '
' + + + '
' + + '
' + + + '
' + + '