/** * The code below uses open source software. Please visit the URL below for an overview of the licenses: * http://js.api.here.com/v3/3.1.8.1/HERE_NOTICE */ H.util.eval("var Ys={};function Zs(a){var b=a.ownerDocument,c=b.documentElement;b=b.defaultView;var d=a.getBoundingClientRect();a=d.left;d=d.top;isNaN(b.pageXOffset)?(a+=c.scrollLeft,d+=c.scrollTop):(a+=b.pageXOffset,d+=b.pageYOffset);return new H(a,d)}function $s(a,b,c){b=Tb(b)?b+\"px\":b;c=Tb(c)?c+\"px\":c;a.style[jf(\"transform\")]=\"translate(\"+b+\",\"+c+\")\"}\nvar at={TOP_LEFT:\"top-left\",TOP_CENTER:\"top-center\",TOP_RIGHT:\"top-right\",LEFT_TOP:\"left-top\",LEFT_MIDDLE:\"left-middle\",LEFT_BOTTOM:\"left-bottom\",RIGHT_TOP:\"right-top\",RIGHT_MIDDLE:\"right-middle\",RIGHT_BOTTOM:\"right-bottom\",BOTTOM_LEFT:\"bottom-left\",BOTTOM_CENTER:\"bottom-center\",BOTTOM_RIGHT:\"bottom-right\"};u(\"H.ui.LayoutAlignment\",at);function bt(a,b){var c={},d={};c[\"top-left\"]=ct(b,\"div\",[dt,et].join(\" \"));c[\"top-center\"]=ct(b,\"div\",[dt,ft,gt,et].join(\" \"));c[\"top-right\"]=ct(b,\"div\",[dt,et].join(\" \"));c[\"left-top\"]=ct(b,\"div\",[dt,ht].join(\" \"));c[\"left-middle\"]=ct(b,\"div\",[dt,it,jt,ht].join(\" \"));c[\"left-bottom\"]=ct(b,\"div\",[dt,ht].join(\" \"));c[\"right-top\"]=ct(b,\"div\",[dt,ht].join(\" \"));c[\"right-middle\"]=ct(b,\"div\",[dt,kt,jt,ht].join(\" \"));c[\"right-bottom\"]=ct(b,\"div\",[dt,ht].join(\" \"));c[\"bottom-left\"]=ct(b,\"div\",[dt,et].join(\" \"));\nc[\"bottom-center\"]=ct(b,\"div\",[dt,lt,gt,et].join(\" \"));c[\"bottom-right\"]=ct(b,\"div\",[dt,et].join(\" \"));d[\"top-left\"]=ct(b,\"div\",[ft,it].join(\" \"));d[\"top-right\"]=ct(b,\"div\",[ft,kt].join(\" \"));d[\"bottom-left\"]=ct(b,\"div\",[lt,it].join(\" \"));d[\"bottom-right\"]=ct(b,\"div\",[lt,kt].join(\" \"));mt(d[\"top-left\"],c[\"top-left\"],c[\"left-top\"]);mt(d[\"top-right\"],c[\"top-right\"],c[\"right-top\"]);mt(d[\"bottom-left\"],c[\"left-bottom\"],c[\"bottom-left\"]);mt(d[\"bottom-right\"],c[\"right-bottom\"],c[\"bottom-right\"]);mt(a,d[\"top-left\"],\nd[\"top-right\"],d[\"bottom-left\"],d[\"bottom-right\"],c[\"top-center\"],c[\"left-middle\"],c[\"right-middle\"],c[\"bottom-center\"]);this.a=c}var ft=\"H_l_top\",lt=\"H_l_bottom\",it=\"H_l_left\",kt=\"H_l_right\",gt=\"H_l_center\",jt=\"H_l_middle\",et=\"H_l_horizontal\",ht=\"H_l_vertical\",dt=\"H_l_anchor\";bt.prototype.update=function(){var a=this.a;nt(a[\"top-center\"],!0);nt(a[\"bottom-center\"],!0);nt(a[\"left-middle\"],!1);nt(a[\"right-middle\"],!1)};\nfunction nt(a,b){b?(b=a.offsetWidth,a.style.marginLeft=-Math.round(.5*b)+\"px\"):(b=a.offsetHeight,a.style.marginTop=-Math.round(.5*b)+\"px\")}bt.prototype.put=function(a,b){a=a?a.J():null;var c=b?this.a[b]:null;a&&c&&(a.parentElement&&a.parentElement.removeChild(a),c.insertBefore(a,/(bottom|right)$/.test(b)||/(center|middle)/.test(b)&&c.childNodes.length%2?c.firstChild:null));this.update()};var ot={IMPERIAL:\"imperial\",METRIC:\"metric\"};u(\"H.ui.UnitSystem\",ot);function pt(){this.a=this.kj()}pt.prototype.kj=function(){var a=Function(\"return this;\")(),b=a.navigator,c=[];b&&(b.msPointerEnabled?c.push(qt):b.pointerEnabled&&c.push(rt));1>c.length&&(\"TouchEvent\"in a&&c.push(st),c.push(tt));return c};pt.prototype.detectEventSets=pt.prototype.kj;pt.prototype.addEventListener=function(a,b,c,d){for(var e=this.a,f,g=e.length,h=!1;g--;)if(f=e[g][b])h=!0,a.addEventListener(f,c,d||!1);h||a.addEventListener(b,c,d||!1)};\npt.prototype.removeEventListener=function(a,b,c,d){for(var e=this.a,f,g=e.length,h=!1;g--;)if(f=e[g][b])h=!0,a.removeEventListener(f,c,d||!1);h||a.removeEventListener(b,c,d||!1)};\nvar rt={start:\"pointerdown\",end:\"pointerup\",move:\"pointermove\",cancel:\"pointercancel\",over:\"pointerover\",out:\"pointerout\",hover:\"pointerhover\"},qt={start:\"MSPointerDown\",end:\"MSPointerUp\",move:\"MSPointerMove\",cancel:\"MSPointerCancel\",over:\"MSPointerOver\",out:\"MSPointerOut\",hover:\"MSPointerHover\"},st={start:\"touchstart\",end:\"touchend\",move:\"touchmove\",cancel:\"touchcancel\"},tt={start:\"mousedown\",end:\"mouseup\",move:\"mousemove\",over:\"mouseover\",out:\"mouseout\",hover:\"mousehover\"};function ct(a,b,c,d){a=a.createElement(b);c&&(a.className=c);d&&(a.innerHTML=d);return a}function mt(a,b){for(var c=1,d=arguments.length;cthis.i.indexOf(a)&&this.i.push(a);b&&(b.className=this.i.join(\" \"));return this};X.prototype.addClass=X.prototype.Oa;\nX.prototype.mb=function(a){a=this.i.indexOf(a);var b=this.J();-1\")};Gt.prototype.s=function(){X.prototype.s.call(this);this.b.removeEventListener(\"update\",this.a)};var It=new X(\"div\",\"H_context_menu_item_separator\");function Jt(a){C(a,Array,Jt,1);Ft.call(this,\"div\",\"H_context_menu\");this.c=a;this.a=null}w(Jt,Ft);u(\"H.ui.context.Menu\",Jt);Jt.prototype.S=function(){Ft.prototype.S.apply(this,arguments);this.c.forEach(function(a){a===De?a=It:(a=new Gt(a),a.addEventListener(\"click\",this.f.bind(this)));this.Na(a)},this);oe(this.J(),[\"mousedown\",\"touchstart\",\"pointerdown\",\"wheel\"],function(a){a.stopPropagation()})};Jt.prototype.renderInternal=Jt.prototype.S;\nJt.prototype.setPosition=function(a,b){if(this.a){var c=this.J();var d=c.offsetWidth;var e=c.offsetHeight;var f=this.a;var g=f.Ba.width;f=f.Ba.height;a+d>g&&a>g/2&&(a-=d);b+e>f&&b>f/2&&(b-=e);$s(c,a,b)}};Jt.prototype.setPosition=Jt.prototype.setPosition;Jt.prototype.f=function(){this.a&&this.a.dispatchEvent(new Ec(\"contextmenuclose\",this.a))};Jt.prototype.Ma=function(a){this.a=a};Jt.prototype.setMap=Jt.prototype.Ma;function Kt(a,b){b=b||{};var c=this;X.call(this,\"div\",\"H_ib H_ib_top\");this.B=A(function(a){c.Dc()||(c.close(),a.preventDefault())},this);this.update=A(this.update,this);this.f=A(this.f,this);this.setPosition(a);this.df(b.content);b.onStateChange&&this.addEventListener(\"statechange\",b.onStateChange);this.R(Lt.OPEN)}w(Kt,X);u(\"H.ui.InfoBubble\",Kt);Kt.prototype.a=null;Kt.prototype.ya=function(){return this.b};Kt.prototype.setPosition=function(a){this.b=Jf(a);this.update()};\nKt.prototype.setPosition=Kt.prototype.setPosition;Kt.prototype.Ma=function(a){this.a=a};\nKt.prototype.S=function(a,b){this.o=ct(b,\"div\",\"H_ib_body\");this.tailEl_=ct(b,\"div\",\"H_ib_tail\");this.j=ct(b,\"div\",\"H_ib_close H_btn\",Mt);this.c=ct(b,\"div\",\"H_ib_content\",\" \");this.o.appendChild(this.j);this.o.appendChild(this.c);vt(this.j,\"start\",this.B);this.a.b.addEventListener(\"sync\",this.update);this.a.Ba.addEventListener(\"sync\",this.update);this.a.addEventListener(\"enginechange\",this.f);a.appendChild(this.o);a.appendChild(this.tailEl_);this.df(this.m)};\nKt.prototype.renderInternal=Kt.prototype.S;Kt.prototype.f=function(){this.v||(this.v=setTimeout(this.update,0))};Kt.prototype.update=function(){var a=this.J(),b=this.a,c,d=\"none\";this.v=0;if(b&&a&&this.getState()===Lt.OPEN){if(c=b.Ga(this.b)){var e=c.x;c=c.y;b=b.Ba.width;if(e>=-b||e<=2*b||c>=-b||c<=2*b)d=\"\",Nt?(a.style.left=e-b+\"px\",a.style.top=c+\"px\"):$s(a,e,c)}a.style.display=d;\"\"===d&&(a.style.visibility=\"visible\")}};var Lt={OPEN:\"open\",CLOSED:\"closed\"};Kt.State=Lt;Kt.prototype.C=Lt.OPEN;\nKt.prototype.getState=function(){return this.C};Kt.prototype.getState=Kt.prototype.getState;Kt.prototype.R=function(a){a!==this.C&&(this.C=a,this.dispatchEvent(\"statechange\"));if(a=this.J())this.C===Lt.OPEN?(a.style.display=\"block\",a.style.visibility=\"hidden\",this.f()):a.style.display=\"none\"};Kt.prototype.setState=Kt.prototype.R;Kt.prototype.close=function(){this.R(Lt.CLOSED)};Kt.prototype.close=Kt.prototype.close;Kt.prototype.open=function(){this.R(Lt.OPEN)};Kt.prototype.open=Kt.prototype.open;\nKt.prototype.am=function(){return this.c||null};Kt.prototype.getContentElement=Kt.prototype.am;\nKt.prototype.df=function(a){if(a)if(\"string\"===typeof a||\"number\"===typeof a.nodeType&&\"string\"===typeof a.nodeName)this.m=a;else throw Error(\"InfoBubble content must be a string or HTML node.\");else this.m=void 0;this.J()&&(this.m?(this.c.innerHTML=\"\",\"string\"===typeof this.m?this.c.innerHTML=a:\"number\"===typeof a.nodeType&&\"string\"===typeof a.nodeName&&this.c.appendChild(a)):this.c.innerHTML=\" \",this.f())};Kt.prototype.setContent=Kt.prototype.df;\nKt.prototype.s=function(){this.close();this.df(null);this.j&&wt(this.j,\"end\",this.B);this.a&&(this.a.b.removeEventListener(\"sync\",this.update),this.a.Ba.removeEventListener(\"sync\",this.update));X.prototype.s.call(this)};var Mt='';function Ot(a){this.c=a;this.a=this.b=null;this.i=0;this.g=22;this.f=A(this.f,this);a=this.c.wc();a.addEventListener(\"mapviewchange\",this.u,!1,this);a=a.a;a.addEventListener(\"add\",this.j,!1,this);a.addEventListener(\"remove\",this.m,!1,this)}function Pt(a,b){a.b&&b&&a.b===b.za()||(a.b&&a.b.removeEventListener(\"tap\",a.f),b?(a.b=b.za(),a.b.addEventListener(\"tap\",a.f),a.i=a.b.min,a.g=a.b.max):(a.b=null,a.i=0,a.g=22))}\nOt.prototype.u=function(a){var b=a.newValue.zoom;this.a&&a.modifiers&a.ZOOM&&(bthis.g)&&this.a.close()};Ot.prototype.j=function(a){a=a.added;Qt(a)&&Pt(this,a)};Ot.prototype.m=function(a){Qt(a.removed)&&(this.a&&this.a.close(),Pt(this,null))};function Qt(a){return window.H.service&&a.za()instanceof window.H.service.traffic.incidents.Provider}\nOt.prototype.f=function(a){var b;if(a.target&&(b=a.target.getData())&&0===a.currentPointer.button){this.a||(this.a=new Kt(a.target.pa()),this.a.Oa(\"H_tib\"),this.c.Wi(this.a));this.a.setPosition(a.target.pa());var c=b.TRAFFIC_ITEM_TYPE_DESC.replace(\" \",\"_\");this.c.xa().qh(\"traffic.\"+c)&&(c=this.c.xa().translate(\"traffic.\"+c));this.a.df('
{{title}}
{{desc}}
{{traffic.from}}{{from}}
{{traffic.until}}{{until}}
'.replace(\"{{title}}\",\nc).replace(\"{{desc}}\",b.TRAFFIC_ITEM_DESCRIPTION[0].value).replace(\"{{traffic.from}}\",this.c.xa().translate(\"traffic.from\")).replace(\"{{traffic.until}}\",this.c.xa().translate(\"traffic.until\")).replace(\"{{from}}\",b.START_TIME).replace(\"{{until}}\",b.END_TIME));this.a.open()}a.stopPropagation()};function Rt(a,b){var c=a.J(),d=this;G.call(this);this.a=a;this.i=c.ownerDocument;this.f={};this.c=[];new Ot(this);this.O=ct(this.i,\"div\",\"H_ui\");this.B=A(function(a){this.u.put(a.target,a.target.Sc)},this);this.addEventListener(\"alignmentchange\",this.B);this.G=A(function(){this.cl()},this);this.addEventListener(\"toggleunitsystem\",this.G);this.O.addEventListener(\"contextmenu\",this.v,!1);this.O.addEventListener(\"MSHoldVisual\",this.v,!1);this.a.addEventListener(\"contextmenu\",this.D,!1,this);this.a.addEventListener(\"contextmenuclose\",\nthis.o,!1,this);this.a.xb(this.F.bind(this));this.b=null;this.m=-1;this.u=new bt(this.O,this.i);this.g=ot.METRIC;St(this,\"en-US\");b&&Tt(this,b);c.appendChild(this.O);y.setTimeout(function(){d.u.update()},1)}w(Rt,G);u(\"H.ui.UI\",Rt);Rt.prototype.v=function(a){for(var b=a.target;b&&!/\\bH_ib_content\\b/.test(b.className);)b=b.parentNode;b||a.preventDefault()};Rt.prototype.J=function(){return this.O};Rt.prototype.getElement=Rt.prototype.J;Rt.prototype.wc=function(){return this.a};\nRt.prototype.getMap=Rt.prototype.wc;Rt.prototype.Zm=function(){return this.g};Rt.prototype.getUnitSystem=Rt.prototype.Zm;Rt.prototype.mg=function(a){var b=this.f,c;if(a!==this.g)for(c in this.g=a,b)if(b[c]instanceof Z)b[c].onUnitSystemChange(this.g)};Rt.prototype.setUnitSystem=Rt.prototype.mg;\nfunction St(a,b){if(ra(b))var c=b;else if(b instanceof Ct){c=b.b;var d=b}else throw Error(\"The locale parameter must be a string or a H.ui.i18n.Localization object.\");if(c)if(d)a.j=d;else if(0<=xt.indexOf(c))a.j=new Ct(c);else throw Error(\"Locale [\"+c+\"] is not supported.\");else throw Error(\"No locale was defined.\");}Rt.prototype.xa=function(){return this.j};Rt.prototype.cl=function(){this.g===ot.METRIC?this.mg(ot.IMPERIAL):this.mg(ot.METRIC)};Rt.prototype.toggleUnitSystem=Rt.prototype.cl;\nRt.prototype.Wi=function(a){var b=this.c.length,c=this.O;if(0>this.c.indexOf(a)){a.ba(this);a.Ma(this.a);var d=a.V(this.i);b=0b&&(b=0);b=(a.m-a.a)*b/a.B;b=du(a,d?a.m-b:a.a+b);a.o!==b&&(a.ng(b,!0),a.dispatchEvent(new wg(a.fk.Ad,b,a.o)))}function hu(a,b){return(b.touches?b.targetTouches[0]:b)[\"page\"+(a.c?\"Y\":\"X\")]}\nfunction iu(a){var b=!1,c=a.type;-1!==c.indexOf(\"pointer\")||-1!==c.indexOf(\"touch\")?b=!0:C(a,MouseEvent)&&(b=1===a.which||1===a.buttons);return b}function ju(a){var b=a.touches;return b&&1===b.length||C(a,MouseEvent)}n=cu.prototype;\nn.Vf=function(a){var b=this.c;if(iu(a)&&ju(a)){var c=hu(this,a);var d=a.target;d===this.j||d.parentElement===this.j?(this.L=c-Zs(this.j)[b?\"y\":\"x\"]-this.j.offsetWidth/2,this.J().className=\"H_slider H_slider_active\"+(this.c?\"\":\" H_l_horizontal\"),this.f=!0):gu(this,c);a.preventDefault()}};n.Xf=function(){this.f&&(this.J().className=\"H_slider \"+(this.c?\"\":\" H_l_horizontal\"),this.f=!1)};n.Wf=function(a){this.f&&a.target===this.b&&(this.f=!1)};\nn.Qf=function(a){this.f&&ju(a)&&(iu(a)?(gu(this,hu(this,a)-this.L),a.preventDefault()):this.f=!1)};n.fk={Ad:\"change\"};\nn.S=function(a,b){var c=ct(b,\"div\",\"H_slider_cont\"),d=ct(b,\"div\",\"H_slider_knob_cont\"),e=ct(b,\"div\",\"H_slider_knob\"),f=ct(b,\"div\",\"H_slider_knob_halo\"),g=ct(b,\"div\",\"H_slider_track\");b=ct(b,\"div\",\"H_slider_track H_slider_track_active\");a.appendChild(c);c.appendChild(g);g.appendChild(b);c.appendChild(d);d.appendChild(e);d.appendChild(f);this.P=g;this.$a=b;this.j=d;this.b||(this.b=a.ownerDocument.body);c.style[this.c?\"height\":\"width\"]=this.ja;this.ng(this.o);eu(this)};\ncu.prototype.renderInternal=cu.prototype.S;cu.prototype.s=function(){fu(this)};cu.prototype.Ca=function(a){a?fu(this):this.P&&eu(this);return X.prototype.Ca.call(this,a)};cu.prototype.setDisabled=cu.prototype.Ca;var ku={\"in\":'',out:''};function Z(){Ft.call(this,\"div\",\"H_ctl\");this.map=null;this.Sc=\"top-left\"}w(Z,Ft);u(\"H.ui.Control\",Z);Z.prototype.Ma=function(a){this.map=a};Z.prototype.V=function(a){return Ft.prototype.V.call(this,a)};Z.prototype.S=function(a,b){Ft.prototype.renderInternal.call(this,a,b);this.Xb(this.Sc)};Z.prototype.renderInternal=Z.prototype.S;Z.prototype.Re=function(){};Z.prototype.onUnitSystemChange=Z.prototype.Re;Z.prototype.wc=function(){return this.map};Z.prototype.getMap=Z.prototype.wc;\nZ.prototype.xa=function(){return this.$a};Z.prototype.getLocalization=Z.prototype.xa;Z.prototype.Tl=function(){return this.Sc};Z.prototype.getAlignment=Z.prototype.Tl;Z.prototype.Xb=function(a){\"string\"===typeof a&&at[a.replace(\"-\",\"_\").toUpperCase()]===a&&(this.Sc=a,this.dispatchEvent(\"alignmentchange\"));return this};Z.prototype.setAlignment=Z.prototype.Xb;function Ut(a){a=a||{};var b=a.slider;Z.call(this);this.o=A(this.o,this);this.v=A(this.v,this);this.a=A(this.a,this);b&&(this.B=A(this.B,this),this.P=b,this.jb=a.sliderSnaps,this.Oa(\"H_zoom_slider\"));this.f=new au({label:ku[\"in\"],onStateChange:this.o});this.j=new au({label:ku.out,onStateChange:this.o});this.Oa(\"H_zoom\");this.Oa(\"H_grp\");this.ca=!1!==a.fractionalZoom;this.setZoomSpeed(a.zoomSpeed||4);this.Xb(a.alignment||\"right-middle\")}w(Ut,Z);u(\"H.ui.ZoomControl\",Ut);\nUt.prototype.dn=function(){return this.L};Ut.prototype.getZoomSpeed=Ut.prototype.dn;Ut.prototype.fo=function(a){this.L=a};Ut.prototype.setZoomSpeed=Ut.prototype.fo;Ut.prototype.Ma=function(a){this.map!==a&&(this.map&&this.map.removeEventListener(\"mapviewchange\",this.v),lu(this));Z.prototype.Ma.apply(this,arguments);this.map&&(this.a(),a.addEventListener(\"mapviewchange\",this.v),a.addEventListener(\"baselayerchange\",this.a))};Ut.prototype.setMap=Ut.prototype.Ma;\nUt.prototype.s=function(){Z.prototype.s.apply(this,arguments);this.map.removeEventListener(\"baselayerchange\",this.a);lu(this)};Ut.prototype.S=function(a,b){Z.prototype.renderInternal.call(this,a,b);Dt(this.f,this.xa().translate(\"zoom.in\"));Dt(this.j,this.xa().translate(\"zoom.out\"))};Ut.prototype.renderInternal=Ut.prototype.S;Ut.prototype.Xb=function(a){var b=this.Sc;Z.prototype.Xb.call(this,a);b!==a&&this.a();return this};Ut.prototype.setAlignment=Ut.prototype.Xb;\nUt.prototype.v=function(a){a=a.target.qb();var b=this.map,c=b.fb()-1;b=b.g||b.vc().getCapabilities().lookAt.zoom;this.P&&this.c.ng(a);this.f.Ca(!1);this.j.Ca(!1);a+c>=b.max&&this.f.Ca(!0);a<=b.min&&this.j.Ca(!0)};function lu(a){a.removeChild(a.c);a.c=null;a.m&&(a.m.removeEventListener(\"minchange\",a.a),a.m.removeEventListener(\"maxchange\",a.a),a.m=null)}\nUt.prototype.o=function(a){a=a.target;var b=a===this.f?1:-1,c=0',\npoint:''};function nu(a){au.call(this,a);this.j=function(a){a.preventDefault()};this.f=A(function(a){this.Dc()||this.toggleState();a.preventDefault()},this)}w(nu,au);u(\"H.ui.base.PushButton\",nu);nu.prototype.S=function(a){vt(a,\"start\",this.f);vt(a,\"end\",this.j);this.Mc(this.He(),!0)};nu.prototype.renderInternal=nu.prototype.S;nu.prototype.no=function(){var a=bu.DOWN;this.R(this.getState()===a?bu.UP:a);return this};nu.prototype.toggleState=nu.prototype.no;\nnu.prototype.s=function(){var a=this.J();a&&wt(a,\"start\",this.f);au.prototype.s.call(this)};var Nt,ou=navigator.userAgent,pu=-1ru;var su=Function(\"return this\")(),Ht=document.createElement(\"T\");function tu(a,b,c){Ah.call(this,a,{icon:uu,visibility:c});vu(this,b)}w(tu,Ah);function vu(a,b){a.sn=b;a.O&&(a.O.textContent=b)}var uu=new rh(ct(su.document,\"span\",\"H_dm_label\"),{onAttach:function(a,b,c){c.O=a;vu(c,c.sn)},onDetach:function(a,b,c){delete c.O}});function wu(a,b){G.call(this);this.b=a;this.a=new tu(this.B,\"\");b.push(this.a);this.hc=new P({objects:b,data:this});this.f=this.f.bind(this)}w(wu,G);wu.prototype.ad=!1;wu.prototype.B={lat:0,lng:0};wu.prototype.Mc=function(a,b){vu(this.a,a);this.a.fa(b)};wu.prototype.f=function(){this.a.wb(this.g)};function xu(a,b){b&&(a.nextSibling=b,b.previousSibling=a)};function yu(a,b,c,d){var e=new K,f=[];xu(a,this);xu(this,b);e.sd(a.ya());e.sd(b.ya());this.c=new Wg(e,{style:c.Zd});this.m=new Wg(e,{style:{strokeColor:\"transparent\",lineWidth:Math.min(100,this.c.Ia().lineWidth+2*(d||5))}});c.c&&(this.j=new Wg(e,{style:c.c}),f.push(this.j));f.push(this.c,this.m);wu.call(this,c,f);this.o=this.u=-1;a=this.hc;a.addEventListener(\"pointermove\",this.D,!0,this);a.addEventListener(\"pointerleave\",this.v,!0,this)}w(yu,wu);yu.prototype.Fe=function(){var a=this.c.pa();return a.we(0).bb(a.we(1))};\nfunction zu(a,b,c){var d=a.c.pa();d.jf(3*c,3,[b.lat,b.lng,0]);a.j&&a.j.fa(d);a.m.fa(d);a.c.fa(d)}yu.prototype.D=function(a){var b=a.currentPointer;a=this.previousSibling.ya();var c=this.nextSibling.ya(),d=this.b.f,e=b.viewportX;b=b.viewportY;if(this.u!==e||this.o!==b)this.u=e,this.o=b,d.fa(this.b.g(a,c,{x:e,y:b})),d.wb(!0)};yu.prototype.v=function(){this.b.f.wb()};yu.prototype.ii=function(){this.Mc(this.b.a(this.Fe()),this.c.I().lb())};function Au(a,b,c){c=b.b(c||0);this.c=new Om(a,{icon:c,zIndex:0});this.c.draggable=!0;wu.call(this,b,[this.c]);a=this.hc;a.addEventListener(\"dragstart\",this.Bn,!0,this);a.addEventListener(\"drag\",this.Cn,!0,this);a.addEventListener(\"dragend\",this.An,!0,this)}w(Au,wu);n=Au.prototype;n.oj=0;n.Oh={Ad:\"change\"};n.Fe=function(){return this.oj};n.ya=function(){return this.c.pa()};\nfunction Bu(a){var b=0;a.nextSibling&&a.previousSibling&&(a.nextSibling.ad||a.previousSibling.ad?a.nextSibling.ad&&!a.previousSibling.ad&&(b=2):b=1);b=a.b.b(b);a.c.ed(b)}n.Cn=function(a){var b=a.currentPointer;a=b.viewportX;b=b.viewportY;if(this.m!==a||this.u!==b)this.m=a,this.u=b,this.c.fa(this.b.map.Wa(a-this.j.x,b-this.j.y)),this.dispatchEvent(new Ec(this.Oh.Ad,this))};\nn.Bn=function(a){var b=a.currentPointer,c=b.viewportX;b=b.viewportY;var d=this.b.map.Ga(this.ya());this.c.ff(1);this.j={x:c-d.x,y:b-d.y};a.stopPropagation()};n.An=function(){this.c.ff(0)};n.ii=function(a){this.oj=a;this.Mc(this.b.a(a),this.ya())};function Cu(a,b){this.c=b;this.b=a;this.a={previousSibling:null,nextSibling:null,ad:!0};Du(this,this.a);this.Uf=A(this.Uf,this)}u(\"H.ui.distanceMeasurement.Model\",Cu);n=Cu.prototype;n.Nf=function(){return this.a.nextSibling===this.a};function Eu(a,b){a=a.a;for(var c=a.nextSibling;c!==a;){var d=c,e=c.previousSibling===a?!1:b;(d.g=e)?d.f():(d.i&&y.clearTimeout(d.i),d.i=y.setTimeout(d.f,100));c=c.nextSibling}}\nfunction Fu(a,b){var c=b||a.a.nextSibling,d=0,e=0;if(b&&!Gu(a,b))throw new D(a.We,0,b);c instanceof Au?d=c.Fe():c instanceof yu&&(d=c.previousSibling.Fe());for(b=c;b&&b!==a.a;b=b.nextSibling,e++)b.ii(d),1===e%2&&(d+=b.Fe())}n.oe=function(a){var b=this.a.previousSibling,c=this.Nf();a=new Au(a,this.c,c?0:2);this.b.T(a.hc);xu(a,this.a);a.addEventListener(a.Oh.Ad,this.Uf);c?Du(this,a):(Hu(this,b,a),Bu(b),Fu(this,b));return a};\nn.insertBefore=function(a,b){var c;var d=1;if(b){if(!Gu(this,b))throw new D(this.insertBefore,1,b);if(c=b.previousSibling.ad)d=0;a=new Au(a,this.c,d);a.addEventListener(a.Oh.Ad,this.Uf);this.b.T(a.hc);c?(c=this.a.nextSibling,Hu(this,a,c),Du(this,a),b=a,Bu(c)):(c=b.previousSibling,b=c.previousSibling,d=c.nextSibling,this.b.La(c.hc),Hu(this,b,a),Hu(this,a,d));Fu(this,b)}else a=this.oe(a);return a};n.ha=function(){Du(this,this.a);this.b.ha()};\nn.We=function(a){var b=this.a,c=a.previousSibling,d=a.nextSibling;if(!Gu(this,a))throw new D(this.We,0,a);this.b.La(a.hc);if(c===b){var e=d;e!==b?(a=e.nextSibling,Du(this,a),a.ii(0),Bu(a),Fu(this,a)):Du(this,this.a)}else d===b?(e=c,a=e.previousSibling,xu(a,b),Bu(a)):c&&d&&(Hu(this,c.previousSibling,d.nextSibling),this.b.td([d.hc,c.hc]),Fu(this,c.previousSibling));e&&e!==b&&this.b.La(e.hc)};function Gu(a,b){for(var c=a.a.nextSibling,d=!1;c!==a.a;){if(c===b){d=!0;break}c=c.nextSibling}return d}\nfunction Hu(a,b,c){b=new yu(b,c,a.c);a.b.T(b.hc)}function Du(a,b){a.a.nextSibling=b;b.previousSibling=a.a}n.Uf=function(a){a=a.target;var b=a.previousSibling,c=a.nextSibling,d=a.ya();if(!c.ad){zu(c,d,!1);var e=a}b.ad||(zu(b,d,!0),e=b.previousSibling);Fu(this,e)};function Yt(a){a=a||{};var b,c=a.lineStyle;Z.call(this);this.v=new nu({label:mu.btn,onStateChange:A(this.yn,this)});this.Na(this.v);if(b=a.distanceFormatter)this.nj=b;c&&(this.Sj=c,this.qk=B);this.Xb(a.alignment||\"right-bottom\");this.m={};this.m[0]=a.startIcon;this.m[2]=a.endIcon;this.m[1]=a.stopoverIcon;this.m[3]=a.splitIcon}w(Yt,Z);u(\"H.ui.DistanceMeasurement\",Yt);n=Yt.prototype;n.Sj={strokeColor:\"rgb(39,44,54)\",lineWidth:5};n.qk={strokeColor:\"white\",lineWidth:7};\nfunction Iu(a){var b=a.map,c,d={};a.f||(a.j=new M,a.c=new Lk(a.j,{pixelRatio:a.map.fb()}),a.B=c=a.j.gc(),a.B.Uk(!0),c.addEventListener(\"dragstart\",a.wn,!0,a),c.addEventListener(\"dragend\",a.hf,!0,a),c.addEventListener(\"pointerenter\",a.hf,!0,a),c.addEventListener(\"pointerleave\",a.xn,!0,a),c.addEventListener(\"tap\",a.Kn,!0,a),a.o=Ju(a),d.a=A(a.nj,a),d.b=A(a.bk,a),d.g=A(a.yj,a),d.map=a.map,d.f=a.o,d.Zd=a.Sj,d.c=a.qk,a.a=new Cu(a.B,d),a.f=!0);a.o&&a.B.T(a.o);b.addEventListener(\"tap\",a.mk,!0,a);b.a.add(a.c)}\nfunction Ku(a){var b=a.map;a.f&&(b.removeEventListener(\"tap\",a.mk,!0,a),b.cg(a.c),a.a.ha())}function Ju(a){function b(){var a=c.Db();a={anchor:c.ld().clone().scale(f).floor(),size:new uh(Lc(a.w*f),Lc(a.h*f)),hitArea:d};return new Si(c.Xc(),a)}var c=a.bk(3),d=new vh(wh.NONE,[]),e,f=c===a.P?.5:1;if(1===c.getState())var g=b();else g=new Si(\"\",{hitArea:d}),c.addEventListener(\"statechange\",function(){1===c.getState()&&e.ed(b())});return e=new Om(a.map.lb(),{visibility:!1,icon:g})}\nn.nj=function(a){var b=\"m\",c=0;\"metric\"===this.L?1E3<=a&&(a/=1E3,b=\"km\",c=1):(a/=.3048,b=\"ft\",5280<=a&&(a/=5280,b=\"mi\",c=1));return a.toFixed(c)+\" \"+this.xa().translate(\"scale.\"+b)};n.yj=function(a,b,c){a=this.map.Ga(a);b=this.map.Ga(b);c=(new H(c.x,c.y)).xj(a,b);return this.map.Wa(c.x,c.y)};\nn.S=function(a,b){var c=22*(this.map.vc().type===Km.WEBGL?1:this.map.fb()),d=c/2;Z.prototype.renderInternal.call(this,a,b);this.L=ot.METRIC;this.P=new Si(mu.point,{anchor:{x:d,y:d},size:{w:c,h:c},hitArea:new vh(wh.CIRCLE,[d,d,d])});Dt(this.v,this.xa().translate(\"distance.measurement\"))};Yt.prototype.renderInternal=Yt.prototype.S;n=Yt.prototype;n.bk=function(a){return this.m[a]||this.P};n.hf=function(){Eu(this.a,!0)};n.wn=function(){Eu(this.a)};n.xn=function(a){\"touch\"!==a.currentPointer.type&&Eu(this.a)};\nn.Kn=function(a){var b=a.currentPointer;var c=a.target.Va;var d;c&&(c=c.getData())instanceof wu&&(d=c);c=d;a=a.originalEvent;a=a.metaKey||a.altKey;c&&(a&&c instanceof Au?this.a.We(c):c instanceof yu&&(a=c.previousSibling.ya(),d=c.nextSibling.ya(),b={x:b.viewportX,y:b.viewportY},this.a.insertBefore(this.yj(a,d,b),c.nextSibling),this.o.wb()),this.hf())};\nn.mk=function(a){var b=a.currentPointer;a=a.target;a!==this.map&&a.getProvider&&a.getProvider()===this.j||(this.a.oe(this.map.Wa(b.viewportX,b.viewportY)),this.o.wb(),this.hf())};n.yn=function(a){\"down\"===a.target.getState()?Iu(this):Ku(this)};n.Re=function(a){this.L=a;this.f&&(Fu(this.a),this.hf())};Yt.prototype.onUnitSystemChange=Yt.prototype.Re;Yt.prototype.s=function(){Ku(this);this.f&&(this.j.F(),this.c.F());Yt.l.s.call(this)};\nYt.prototype.Ma=function(a){a?this.v.getState()===bu.DOWN&&(this.map=a,Iu(this)):(Ku(this),this.f=!1);Z.prototype.Ma.apply(this,arguments)};Yt.prototype.setMap=Yt.prototype.Ma;function Lu(){this.C=Mu.CLOSED;Ft.call(this,\"div\",\"H_overlay\")}w(Lu,Ft);u(\"H.ui.base.OverlayPanel\",Lu);Lu.prototype.R=function(a,b){if(a!==this.C||b)this.C=a,a===Mu.OPEN?this.Oa(\"H_open\"):this.mb(\"H_open\");return this};Lu.prototype.setState=Lu.prototype.R;Lu.prototype.getState=function(){return this.C};Lu.prototype.getState=Lu.prototype.getState;\nLu.prototype.uk=function(a){var b=a.Sc;a=a.J();var c=this.J(),d=c.style;this.mb(\"H_top\");this.mb(\"H_middle\");this.mb(\"H_bottom\");this.mb(\"H_left\");this.mb(\"H_center\");this.mb(\"H_right\");d.bottom=d.top=d.left=d.right=d.margin=\"\";if(/top/g.test(b)){this.Oa(\"H_top\");d.top=\"0\";d.margin=\"0 12px\";var e=-1}else/bottom/g.test(b)?(this.Oa(\"H_bottom\"),d.bottom=\"0\",d.margin=\"0 12px\",e=1):(this.Oa(\"H_middle\"),d.top=\"50%\",d.margin=\"0 12px\",d.marginTop=-Math.round(.5*\nc.offsetHeight)+\"px\",e=0);/left/g.test(b)?(this.Oa(\"H_left\"),d.left=a.offsetWidth+\"px\",d.marginLeft=\"12px\"):/right/g.test(b)?(this.Oa(\"H_right\"),d.right=a.offsetWidth+\"px\",d.marginRight=\"12px\"):(this.Oa(\"H_center\"),d.left=\"50%\",0>e?(d.top=a.offsetHeight+\"px\",d.marginTop=\"12px\"):0',onStateChange:A(function(a){a.target.getState()===bu.DOWN?(this.c.R(Mu.OPEN),this.c.uk(this)):\nthis.c.R(Mu.CLOSED)},this)});this.j=new Nu({title:c,onActiveButtonChange:function(){a:{var a=this.j.Cf();for(var b=a.length;b--;)if(a[b].getState()===bu.DOWN){a=a[b];break a}a=null}a=a.getData();this.map.xd(this.m[a].layer)}.bind(this)});this.v=new Ft(\"div\",\"H_grp\");this.P=new X(\"div\",\"H_separator\");this.Na(this.B);this.Na(this.c);this.c.Na(this.j);this.c.Na(this.P);this.c.Na(this.v);Pu(this)};Wt.prototype.renderInternal=Wt.prototype.S;\nfunction Pu(a){var b=a.xa();a.m.forEach(function(a,d){this.j.Bg(new nu({label:Qu(b,a.label),data:d,disabled:!a.layer}))},a);a.f.forEach(function(a,d){this.v.Na(new nu({label:Qu(b,a.label),onStateChange:this.L.bind(this,a.layer),data:d,disabled:!a.layer}))},a);a.P.wb(!(!a.f.length||!a.m.length));y.setTimeout(function(){this.map&&(this.a(),this.B.Ca(!(this.m&&this.m.length||this.f&&this.f.length)))}.bind(a))}\nWt.prototype.a=function(){var a=this.map.g,b=this.map.a;this.m.forEach(function(b,d){this.j.Cf()[d].R(bu[b.layer===a?\"DOWN\":\"UP\"],!0)},this);this.f.forEach(function(a,d){d=this.v.$g()[d];a.layer?d.R(bu[-1!==b.indexOf(a.layer)?\"DOWN\":\"UP\"],!0):d.Ca(!0)},this)};Wt.prototype.L=function(a,b){b.target.getState()===bu.DOWN?this.map.Yi(a):this.map.cg(a)};function Qu(a,b){return/^layers?/.test(b)&&a.qh(b)?a.translate(b):b}Wt.prototype.o=function(){this.B.R(bu.UP)};\nWt.prototype.s=function(){Wt.l.s.call(this);this.G()};function Vt(a){a=a||{};Z.call(this);this.c=new nu({label:'',\nonStateChange:A(this.zn,this)});this.Na(this.c);this.Xb(a.alignment||\"right-bottom\")}w(Vt,Z);u(\"H.ui.ZoomRectangle\",Vt);n=Vt.prototype;\nn.zn=function(a){var b=this.map,c=b.Ba.element;a.target.getState()===bu.DOWN?(b.addEventListener(\"dragstart\",this.dk,!0,this),b.addEventListener(\"drag\",this.ek,!0,this),b.addEventListener(\"dragend\",this.ck,!0,this),a=c.ownerDocument.createElement(\"div\"),a.className=\"H_zoom_lasso\",c.appendChild(a),this.a=a):(b.removeEventListener(\"dragstart\",this.dk,!0,this),b.removeEventListener(\"drag\",this.ek,!0,this),b.removeEventListener(\"dragend\",this.ck,!0,this),c.removeChild(this.a))};\nn.dk=function(a){var b=this.a.style,c=a.currentPointer,d=c.viewportX;c=c.viewportY;a.target===this.map&&(a.stopPropagation(),b.width=\"0px\",b.height=\"0px\",b.top=c+\"px\",b.left=d+\"px\",b.display=\"block\",this.j=c,this.f=d)};n.ek=function(a){var b=a.currentPointer,c=b.viewportX,d=b.viewportY;b=this.f;var e=this.j,f=this.a.style;a.target===this.map&&(a.stopPropagation(),a=c-b,c=d-e,f.left=b+(0>a?a:0)+\"px\",f.top=e+(0>c?c:0)+\"px\",f.width=Math.abs(a)+\"px\",f.height=Math.abs(c)+\"px\")};\nn.ck=function(a){var b=this.map,c=a.currentPointer;a.target===this.map&&(a.stopPropagation(),this.a.style.display=\"none\",b.b.Yb({bounds:Qf([b.Wa(this.f,this.j),b.Wa(c.viewportX,c.viewportY)])},!0))};n.S=function(a,b){Z.prototype.renderInternal.call(this,a,b);Dt(this.c,this.xa().translate(\"zoom.rectangle\"))};Vt.prototype.renderInternal=Vt.prototype.S;function Ru(a,b){b=b||{};if(!(a&&a instanceof Dk))throw Error(\"Base layer is mandatory for overview UI element\");Z.call(this);this.c=new nu({label:'',onStateChange:A(this.f,this)});this.Na(this.c);this.a=\nnew Su(a,b.zoomDelta,b.scaleX,b.scaleY);this.Xb(b.alignment||\"right-bottom\");this.Na(this.a)}w(Ru,Z);u(\"H.ui.Overview\",Ru);Ru.prototype.xd=function(a){this.a.xd(a);return this};Ru.prototype.setBaseLayer=Ru.prototype.xd;Ru.prototype.f=function(a){a.target.getState()===bu.DOWN?(a=this.a,Tu(a,!0),a.Ai(),a.Oa(\"H_overview_active\"),a.a.addEventListener(\"mapviewchange\",a.Ai,!1,a)):Uu(this.a)};\nRu.prototype.S=function(a,b){Z.prototype.renderInternal.call(this,a,b);this.c.J().style[\"float\"]=this.Sc.match(\"right\")?\"right\":\"left\";this.a.Ma(this.map);Dt(this.c,this.xa().translate(\"minimap\"))};Ru.prototype.renderInternal=Ru.prototype.S;Ru.prototype.s=function(){this.a.F();X.prototype.s.call(this)};function Su(a,b,c,d){this.m=a;\"number\"===typeof b&&(this.el=b);\"number\"===typeof c&&(this.rk=c);\"number\"===typeof d&&(this.sk=d);Ft.call(this,\"div\",\"H_overview\")}w(Su,Z);Su.prototype.xd=function(a){this.c.xd(a)};\nSu.prototype.S=function(a,b){b=ct(b,\"div\",\"H_overview_map\");mt(a,b);this.f=b};Su.prototype.renderInternal=Su.prototype.S;n=Su.prototype;n.el=3;n.rk=5;n.sk=5;n.Ma=function(a){this.a=a;this.c=new S(this.f,this.m,{pixelRatio:this.a.fb(),engineType:this.a.vc().type});this.c.m.J().style.display=\"none\";this.o=this.c.b;this.j=this.a.b};function Uu(a){!a.Bd&&Tu(a);a.mb(\"H_overview_active\");a.a.removeEventListener(\"mapviewchange\",a.Ai,!1,a)}\nn.Ai=function(a){a&&a.modifiers&a.SIZE&&Tu(this,!0);a=this.j.pb();a.zoom=a.zoom-this.el;this.o.Yb(a)};function Tu(a,b){var c=a.a.Ba.element,d=a.J().style,e=c.offsetWidth/a.rk/10;c=c.offsetHeight/a.sk/10;var f=a.f.style;b?(d.width=e+\"em\",d.height=c+\"em\",f.width=e+\"em\",f.height=c+\"em\"):d.width=d.height=\"0em\";a.c.Ba.resize()}n.s=function(){Su.l.s.call(this);Uu(this);this.c.F();this.c=this.o=this.j=this.a=this.m=this.f=null};function Xt(a){a=a||{};Z.call(this);this.Oa(\"H_scalebar\");this.Xb(a.alignment||\"right-bottom\");this.B=150;this.update=A(this.update,this);this.m=this.c=this.a=this.j=null}w(Xt,Z);u(\"H.ui.ScaleBar\",Xt);\nXt.prototype.S=function(a,b){Z.prototype.renderInternal.call(this,a,b);a.innerHTML='
';a.style.direction=\"ltr\";this.j=a.firstChild;b=this.j.childNodes;this.a=b[0];this.c=b[1];this.m=a.lastChild;this.o=ot.METRIC;this.v=\nA(function(a){this.Dc()||(this.dispatchEvent(\"toggleunitsystem\"),a.preventDefault())},this);this.f=A(function(a){a.preventDefault()},this);vt(a,\"start\",this.f);vt(a,\"end\",this.v);Dt(this,this.xa().translate(\"scale.switchToImperial\"));this.update()};Xt.prototype.renderInternal=Xt.prototype.S;Xt.prototype.Ma=function(a){this.map&&this.map.removeEventListener(\"mapviewchange\",this.update);a&&a.addEventListener(\"mapviewchange\",this.update);Z.prototype.Ma.apply(this,arguments)};Xt.prototype.setMap=Xt.prototype.Ma;\nXt.prototype.capture=function(a,b,c){var d=this.J();var e=d.ownerDocument,f=e.createElement(\"canvas\"),g=f.getContext(\"2d\"),h=e.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),k=e.createElementNS(\"http://www.w3.org/2000/svg\",\"foreignObject\"),l=We(d,e,!1);e=parseFloat(d.offsetWidth)+1;var m=parseFloat(d.offsetHeight),p=e*a;a*=m;f.width=p;f.height=a;h.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");h.setAttribute(\"width\",p);h.setAttribute(\"height\",a);h.setAttribute(\"viewBox\",\"0 0 \"+e+\" \"+m);k.setAttribute(\"width\",\n\"100%\");k.setAttribute(\"height\",\"100%\");h.appendChild(k);l.setAttribute(\"width\",\"100%\");l.setAttribute(\"height\",\"100%\");l.setAttribute(\"xmlns\",\"http://www.w3.org/1999/xhtml\");var q=window.getComputedStyle(d);\"box-shadow display align-items font font-family font-size height text-shadow direction\".split(\" \").forEach(function(a){l.style.setProperty(a,q.getPropertyValue(a))});k.appendChild(l);d=Ne(h.outerHTML);(new cf(\"image\",d)).then(function(a){g.drawImage(a,0,0);b(f)},c)};Xt.prototype.capture=Xt.prototype.capture;\nXt.prototype.Re=function(a){this.o=a;Dt(this,\"imperial\"===a?this.xa().translate(\"scale.switchToMetric\"):this.xa().translate(\"scale.switchToImperial\"));this.update()};Xt.prototype.onUnitSystemChange=Xt.prototype.Re;\nXt.prototype.update=function(){if(this.J()){var a=this.B;var b=0;var c=this.map;var d;if(c){var e=Math.round(.5*c.Ba.width);var f=Math.round(.5*c.Ba.height);if(d=c.Wa(e,f))b=Jf(d),c=Jf(c.Wa(e+1,f)),b=100*b.bb(c)}if(c=b)this.o===ot.IMPERIAL?cc?(f=c,e=this.xa().translate(\"scale.m\")):(f=c/1E3,e=this.xa().translate(\"scale.km\")),c=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),f=c/f*100,fa&&(c/=2,f/=2),f=Math.round(f),this.j.setAttribute(\"width\",f),this.m.textContent=c+\" \"+e,this.a.points.getItem(2).x=this.c.points.getItem(2).x=this.a.points.getItem(3).x=this.c.points.getItem(3).x=f-2}};var Vu=1609.344,Wu=.3048006;u(\"H.ui.buildInfo\",function(){return qf(\"mapsjs-ui\",\"1.8.1\",\"e2f2d80\")});\n");