KRes.RoutingNoTieFound={de:"Keinen Wegenetzpunkt gefunden",en:"No route network tie found",pl:"Nie znaleziono tie sieć tras"} KRes.RoutingCalcError={de:"Route konnte nicht berechnet werden",en:"The route could not be calculated",pl:"Trasa nie może zostać obliczona"} KRes.RoutingCMenuStart={de:"Route von hier",en:"Route from here",pl:"trasa stąd"} KRes.RoutingCMenuDestination={de:"Route nach hier",en:"Route to here",pl:"trasa tutaj"} KRes.RoutingCMenuStopover={de:"Zwischenstopp",en:"Stopover",pl:"przerwa w podróży"} KRes.RoutingCMenuClear={de:"Route löschen",en:"Clear route",pl:"wyczyść trasę"} KMap.prototype.RoutingFindTie=function(tieType,gx,gy,index,caption){ var m=this; KInternet.HTTPRequest("routing-service.php",function(r,json){ if(r.substr(0,4)=="ERR="){ alert(r.substr(4)); }else if(json && json.pt){ var tie={type:tieType,pt:json.pt}; if(caption) tie.description={caption:caption}; else if(json.properties.locality && json.properties.locality.s[json.properties.locality.n]) { tie.description={caption:json.properties.locality.s[json.properties.locality.n]}; if(json.properties.name) tie.description.caption+=", "+json.properties.name; } m.RoutingInsertTie(tie,index); }else alert(m.s("RoutingNoTieFound")); },JSON.stringify({request:"find",mode:this.RoutingMode[this.RoutingType],priority:this.RoutingPriority[this.RoutingType],opts:this.RoutingOpts,findDistance:Math.round(Math.max(6*this.mpp,75/.6)),pt:[gx,gy]})); }; KMap.prototype.RoutingInsertTie=function(tie,index,silent){ var m=this; if(tie.type==1){ if(m.RoutingTies.length!=0 && m.RoutingTies[0].type==1) m.RoutingTies[0]=tie;else m.RoutingTies.unshift(tie); }else if(tie.type==2){ if(m.RoutingTies.length!=0 && m.RoutingTies[m.RoutingTies.length-1].type==2) m.RoutingTies[m.RoutingTies.length-1]=tie;else m.RoutingTies.push(tie); }else if(index!==undefined && index>-1 && index3){ var mf=new MemoryFile(response); if(mf.readCharsASCII(4)=="ERR="){alert(m.s("RoutingCalcError")+"\n"+mf.readCharsASCII(mf.size-4));return;} delete mf; m.RoutingLoad(response,false); }else console.error("got empty response"); },JSON.stringify({request:"tour",mode:m.RoutingMode[m.RoutingType],priority:m.RoutingPriority[m.RoutingType],opts:m.RoutingOpts,optimize:m.RoutingOptimize,ties:ties}),true); }; KMap.prototype.RoutingLoad=function(arrayBuffer,loadTies){ var m=this; var tour=m.RoutingReadKRT(arrayBuffer,true,true); //console.log(tour); if(loadTies){ m.RoutingTies=[]; for(var a=0;ab.type?-1:1; }); } return o; }; KMap.prototype.RoutingClear=function(){ this.RoutingTies=[];this.RoutingTour=null;this.RoutingKRT=null; this.RoutingTiesUnDraw(); this.OnRoutingTiesChanged(); this.OnRoutingClear(); this.PoiStaticShapesClear(); this.Load(); } KMap.prototype.OnRoutingTiesChanged=function(){ // can be overwritten }; KMap.prototype.OnNewRoute=function(){ // can be overwritten }; KMap.prototype.OnRoutingClear=function(){ // can be overwritten }; KMap.prototype.UserReport=function(){ window.open("http://www.kulturlandschaft-informatik.de/feedback/trails.php?x="+Math.round(Map.xmin+Map.cmenux*Map.mpp)+"&y="+Math.round(Map.ymax-Map.cmenuy*Map.mpp)); }; KMap.prototype.RoutingType="bike"; KMap.prototype.RoutingMode={bike:0,foot:10}; KMap.prototype.RoutingPriority={bike:1,foot:3}; KMap.prototype.RoutingOpts=0; KMap.prototype.RoutingOptimize=false; KMap.prototype.RoutingTies=[]; KMap.prototype.RoutingTour=null; KMap.prototype.RoutingKRT=null; KMap.prototype.RoutingImgs=[]; function RoutingWrapNew(){ KMap.prototype.RoutingOldNew=KMap.prototype.AfterConstruct; KMap.prototype.AfterConstruct=function(){ var m=this; m.RoutingOldNew(); m.RoutingOldOnBeforeCMenu=m.OnBeforeCMenu; m.OnBeforeCMenu=function(items){ m.RoutingOldOnBeforeCMenu(items); var find=function(type){ m.RoutingFindTie(type,Math.round(m.xmin+m.cmenux*m.mpp),Math.round(m.ymax-m.cmenuy*m.mpp)); }; items.push( {caption:m.s("RoutingCMenuStart"),func:function(){find(1)}}, {caption:m.s("RoutingCMenuDestination"),func:function(){find(2)}}, {caption:m.s("RoutingCMenuStopover"),func:function(){find(3)}}, {caption:m.s("RoutingCMenuClear"),func:function(){m.RoutingClear()},gapAfter:true} ); }; m.RoutingOldAfterLoad=m.AfterLoad; m.AfterLoad=function(){ m.RoutingOldAfterLoad(); m.RoutingTiesDraw(); } } } RoutingWrapNew(); KMap.prototype.ImgTie={ "1":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNTYiIHdpZHRoPSI1NiI+PHBhdGggZD0ibSAyNy4xMzkxNDUsMC43NTg4NjU5MSAwLDI4LjM0MTEzNDA5IDEuNjkyOTQ0LDAgMCwtMjguMzQxMTM0MDkgLTEuNjkyOTQ0LDAgeiIgc3R5bGU9ImZpbGw6IzAwMDAwMCIvPjxwYXRoIGQ9Im0gMjguODk3NzMyLDAuODQ0NTg0OTEgMTkuOTU0NjQ4LDAuMDExODIgLTAuMDA4MywxMS45NzQwODAwOSAtMTkuOTU0NjQ4LC0wLjAxMTgyIDAuMDA4MywtMTEuOTc0MDgwMDkgeiIgc3R5bGU9ImZpbGw6IzAwMDAwMCIvPjxwYXRoIHN0eWxlPSJmaWxsOiNmZmZmZmYiIGQ9Ik0gNDQuNjU5ODU2LDcuMDI4ODEwOCBDIDQ0LjcyNjQ1Nyw2Ljc2OTI4MzMgNDQuNjk2ODI0LDYuNjg2MTA2NyA0NC42MTk4NSw2LjQ0MTc4MDkgNDQuNDgwODQ1LDYuMTcyNDUzMyA0NC4zOTY4MjgsNi4wNjk3NzM2IDQ0LjEyOTc3NSw1Ljc1Njg3NDEgNDIuOTUzMDA5LDQuNTg4MTA2IDQxLjc4NjQ1MiwzLjQwODUzMjQgNDAuNjAzMjc1LD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