/** * 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("function lq(a){var b=a.ownerDocument;b=b.documentElement||b.body.parentNode||b.body;try{var c=a.getBoundingClientRect()}catch(d){c={top:0,right:0,bottom:0,left:0,height:0,width:0}}return{x:c.left+(\"number\"===typeof window.pageXOffset?window.pageXOffset:b.scrollLeft),y:c.top+(\"number\"===typeof window.pageYOffset?window.pageYOffset:b.scrollTop)}}var mq=/Edge\\/\\d+/.test(navigator.appVersion),nq=/(A|a)ndroid/.test(navigator.appVersion),oq=Function(\"return this\")();function pq(a,b,c,d,e,f,g){pq.l.constructor.call(this,a);this.pointers=b;this.changedPointers=c;this.targetPointers=d;this.currentPointer=e;this.originalEvent=g;this.target=f}w(pq,Ec);u(\"H.mapevents.Event\",pq);function qq(a,b,c,d,e,f){if(isNaN(a))throw Error(\"x needs to be a number\");if(isNaN(b))throw Error(\"y needs to be a number\");if(isNaN(c))throw Error(\"pointer must have an id\");this.viewportX=a;this.viewportY=b;this.target=null;this.id=c;this.type=d;this.dragTarget=null;this.a=this.button=Lb(e)?e:-1;this.buttons=Lb(f)?f:0}u(\"H.mapevents.Pointer\",qq);\nfunction rq(a,b,c){if(isNaN(b))throw Error(\"x needs to be a number\");if(isNaN(c))throw Error(\"y needs to be a number\");a.viewportX=b;a.viewportY=c}qq.prototype.tm=function(){return this.a};qq.prototype.getLastChangedButton=qq.prototype.tm;function sq(a,b){a.a=b;a.buttons|=qq.prototype.b[+b]||0}function tq(a,b){a.a=b;a.buttons&=~(qq.prototype.b[+b]||0)}qq.prototype.b=[1,4,2];var uq={NONE:-1,LEFT:0,MIDDLE:1,RIGHT:2};qq.Button=uq;function vq(a){this.a=a instanceof Array?a.slice(0):[]}n=vq.prototype;n.clear=function(){this.a.splice(0,this.a.length)};n.length=function(){return this.a.length};n.indexOf=function(a){for(var b=this.a.length;b--;)if(this.a[b].id===a)return b;return-1};function wq(a,b){b=a.indexOf(b);return-1!==b?a.a[b]:null}n.remove=function(a){a=this.indexOf(a);return-1!==a?this.a.splice(a,1)[0]:null};function xq(a,b){for(var c=a.a.length,d=[];c--;)a.a[c].type!==b&&d.push(a.a[c]);a.a=d}\nfunction yq(a,b){for(var c=a.a.length;c--;)if(a.a[c].dragTarget===b)return!0;return!1}n.push=function(a){if(a instanceof qq)return this.a.push(a);throw Error(\"list needs a pointer\");};n.ab=function(){return this.a};n.clone=function(){return new vq(this.a)};function zq(a,b,c){c=c||{};if(!(a instanceof S))throw Error(\"events: map instance required\");if(!(b instanceof Array))throw Error(\"events: map array required\");Ac.call(this);this.Og=c.Og||300;this.gj=c.gj||50;this.Yk=c.Yk||50;this.Zk=c.Zk||500;this.Bh=c.Bh||900;this.Uj=c.Uj||50;this.map=a;this.u=this.map.Ba;this.i=this.u.element;this.D=b;this.a=new vq;this.b=new vq;this.g={};this.c=null;this.o=!0;this.W={};this.m={};this.j=null;this.ue=A(this.ue,this);this.B={pointerdown:this.Hl,pointermove:this.Il,\npointerup:this.Jl,pointercancel:this.Gl};Aq(this)}w(zq,Ac);function Aq(a,b){var c,d=a.D.length;for(c=0;ce||0>b||e>=d.width||b>=d.height)c(z);else{var f=a.map;f.Qd(e,b,function(a){c(a||f)})}}}\nn.Jl=function(a,b,c){a.target=b;Eq(this,a,c);Fq(this,b,\"pointerup\",c,a);\"mouse\"!==a.type&&Fq(this,b,\"pointerleave\",c,a);b=this.g[a.id];var d={x:a.viewportX,y:a.viewportY},e=c.timeStamp,f=a.target,g=this.j;b&&b.target===f&&b.Gg.bb(d)=b.length){c=this.a.clone();for(d=b.length;d--;)c.remove(b[d].identifier);for(d=c.length();d--;)this.a.remove(c.a[d].id);this.b=c;Bq(this,\"pointercancel\",a);this.b.clear()}if(this.G[a.type]){b=lq(this.u.element);c=a.type;d=a.changedTouches;var e=d.length,f;this.b.clear();for(f=0;fa.Bh&&(a.v=!0,e.dispatchEvent(new Lq(b,c,e,d)),pe(f.J(),a.Ki,a.lj,!1,a)):f.Qd(b,c,a.vn.bind(a,b,c,d))}n.vn=function(a,b,c,d){d=d&&r(d.dispatchEvent)?d:this.map;Nq(this,a,b,c,d)};n.Ki=[\"mousedown\",\"touchstart\",\"pointerdown\",\"wheel\"];\nn.lj=function(){this.v&&(this.v=!1,this.map.dispatchEvent(new Ec(\"contextmenuclose\",this.map)))};n.s=function(){var a=this.map.J();clearInterval(this.f);a&&we(a,this.Ki,this.lj,!1,this);zq.prototype.s.call(this)};function Oq(a,b,c,d,e){Oq.l.constructor.call(this,\"wheel\");this.delta=a;this.viewportX=b;this.viewportY=c;this.target=d;this.originalEvent=e}w(Oq,Ec);u(\"H.mapevents.WheelEvent\",Oq);function Pq(a){var b=\"onwheel\"in document;this.P=b;this.G=(b?\"d\":\"wheelD\")+\"elta\";this.f=A(this.f,this);Pq.l.constructor.call(this,a,[{Sa:(b?\"\":\"mouse\")+\"wheel\",listener:this.f}]);this.v=this.map.Ba}w(Pq,zq);\nPq.prototype.f=function(a){if(!a.fl){var b=lq(this.i);var c=a.pageX-b.x;b=a.pageY-b.y;var d=this.G,e=a[d+(d+\"Y\"in a?\"Y\":\"\")],f;mq&&\"rtl\"===y.getComputedStyle(this.v.element).direction&&(c-=(y.devicePixelRatio-1)*this.v.width);if(e){var g=Math.abs;var h=g(e);e=(!(f=a[d+\"X\"])||3<=h/g(f))&&(!(f=a[d+\"Z\"])||3<=h/g(f))?((0e))*(this.P?1:-1):0}c=new Oq(e,c,b,null,a);c.delta&&(a.stopImmediatePropagation(),a.preventDefault(),this.map.Qd(c.viewportX,c.viewportY,this.L.bind(this,c)))}};\nPq.prototype.L=function(a,b){var c=a.target=b||this.map,d,e;setTimeout(function(){c.dispatchEvent(a);a.f||(d=a.originalEvent,e=new y.WheelEvent(\"wheel\",d),e.fl=1,d.target.dispatchEvent(e))},0)};function Qq(a){var b=window;this.f=A(this.f,this);zq.call(this,a,[{Sa:\"mousedown\",listener:this.f},{Sa:\"mousemove\",listener:this.f,target:b},{Sa:\"mouseup\",listener:this.f,target:b},{Sa:\"mouseover\",listener:this.f},{Sa:\"mouseout\",listener:this.f},{Sa:\"dragstart\",listener:this.v}])}w(Qq,zq);\nQq.prototype.f=function(a){var b=a.type,c=lq(this.i);c={x:a.pageX-c.x,y:a.pageY-c.y};var d;(d=this.a.a[0])||(d=new qq(c.x,c.y,1,\"mouse\"),this.a.push(d));this.b.push(d);rq(d,c.x,c.y);/^mouse(?:move|over|out)$/.test(b)?Bq(this,\"pointermove\",a):(/^mouse(down|up)$/.test(b)&&(c=a.which-1,\"up\"===oq.RegExp.$1?tq(d,c):sq(d,c)),Bq(this,b.replace(\"mouse\",\"pointer\"),a));this.b.clear()};Qq.prototype.v=function(a){a.preventDefault()};function Rq(a){var b=a.Ba.element.style;if(-1!==Sq.indexOf(a))throw Error(\"InvalidArgument: map is already in use\");this.a=a;Sq.push(a);b.msTouchAction=b.touchAction=\"none\";nq||!window.PointerEvent&&!window.MSPointerEvent?(this.c=new Hq(this.a),this.b=new Qq(this.a)):this.c=new Iq(this.a);this.g=new Pq(this.a);this.f=new Mq(this.a);this.a.xb(this.F,this);Ac.call(this)}w(Rq,Ac);u(\"H.mapevents.MapEvents\",Rq);Rq.prototype.c=null;Rq.prototype.b=null;Rq.prototype.g=null;Rq.prototype.f=null;\nvar Sq=[];Yb(Sq);Rq.prototype.F=function(){this.a=null;this.c.F();this.g.F();this.f.F();this.b&&this.b.F();Sq.splice(Sq.indexOf(this.a),1);Ac.prototype.F.call(this)};Rq.prototype.dispose=Rq.prototype.F;Rq.prototype.Vl=function(){return this.a};Rq.prototype.getAttachedMap=Rq.prototype.Vl;function Tq(a,b){var c;if(-1!==Uq.indexOf(a))throw new D(Tq,0,\"events are already used\");b=b||{};Ac.call(this);this.a=c=a.a;this.j=a;Uq.push(a);c.draggable=!0;this.i=b.kinetics||{duration:600,Jd:Ll};this.m=b.modifierKey||\"Alt\";this.enable(b.enabled);this.c=c.Ba;this.f=this.c.element;this.g=0;c.addEventListener(\"dragstart\",this.Lh,!1,this);c.addEventListener(\"drag\",this.$j,!1,this);c.addEventListener(\"dragend\",this.Kh,!1,this);c.addEventListener(\"wheel\",this.pk,!1,this);c.addEventListener(\"dbltap\",\nthis.jk,!1,this);c.addEventListener(\"pointermove\",this.ak,!1,this);oe(this.f,\"contextmenu\",this.Zj,!1,this);a.xb(this.F,this)}w(Tq,Ac);u(\"H.mapevents.Behavior\",Tq);var Uq=[];Yb(Uq);Tq.prototype.b=0;var Vq={Ri:1,Ti:2,Ao:4,to:8,uo:16,bc:32,pc:64};Tq.DRAGGING=1;Tq.WHEELZOOM=4;Tq.DBLTAPZOOM=8;Tq.FRACTIONALZOOM=16;Tq.Feature={PANNING:1,PINCH_ZOOM:2,WHEEL_ZOOM:4,DBL_TAP_ZOOM:8,FRACTIONAL_ZOOM:16,HEADING:64,TILT:32};\nfunction Wq(a,b){if(a!==+a||a%1||0>a||2147483647Nc(b[0].viewportY-b[1].viewportY)&&(e|=Vq.bc):a.uh&Tk.TILT&&(e|=Vq.bc))));e&=a.b;return(e&Vq.bc?Tk.TILT:0)|(e&Vq.pc?Tk.HEADING:0)|(e&Vq.Ti?Tk.ZOOM:0)|(e&Vq.Ri?Tk.COORD:0)}\nfunction Yq(a){var b=a.pointers;a=b[0];b=b[1];a=[a.viewportX,a.viewportY];b&&a.push(b.viewportX,b.viewportY);return a}n=Tq.prototype;n.uh=0;n.Lh=function(a){var b=Xq(this,a,!0);if(this.uh=b){var c=this.c;a=Yq(a);c.startInteraction(b,this.i);c.interaction.apply(c,a);if(this.b&4&&!(this.b&16)&&(b=a[0],c=a[1],this.g)){a=this.a.qb();var d=(0>this.g?Mc:Lc)(a);a!==d&&(this.g=0,Zq(this,a,d,b,c))}}};\nn.$j=function(a){var b=Xq(this,a,!1);if(b!==this.uh)\"pointerout\"!==a.originalEvent.type&&\"pointerover\"!==a.originalEvent.type&&(this.Kh(a),this.Lh(a));else if(b){b=this.c;var c=Yq(a);b.interaction.apply(b,c);a.originalEvent.preventDefault()}};n.Kh=function(a){Xq(this,a,!1)&&this.c.endInteraction(!this.i)};\nfunction Zq(a,b,c,d,e){a=a.a.b;if(isNaN(+b))throw Error(\"start zoom needs to be a number\");if(isNaN(+c))throw Error(\"to zoom needs to be a number\");0!==+c-+b&&(a.startControl(null,d,e),a.control(0,0,6,0,0,0),a.endControl(!0,function(a){a.zoom=c}))}n.pk=function(a){if(!a.defaultPrevented&&this.b&4){var b=a.delta;var c=this.a.qb();var d=this.a;var e=d.vc().type;d=this.b&16?c-b:(0>-b?Mc:Lc)(c)-b;if(e===Km.P2D||e===Km.WEBGL)Zq(this,c,d,a.viewportX,a.viewportY),this.g=b;a.preventDefault()}};n.ak=function(){};\nn.jk=function(a){var b=a.currentPointer,c=this.a.qb(),d=a.currentPointer.type,e=this.a.vc().type;(e===Km.P2D||e===Km.WEBGL)&&this.b&8&&(a=\"mouse\"===d?0===a.originalEvent.button?-1:1:0-a?Mc:Lc)(c)-a,Zq(this,c,a,b.viewportX,b.viewportY))};n.Zj=function(a){return this.b&8?(a.preventDefault(),!1):!0};\nn.F=function(){var a=this.a;a&&(a.draggable=!1,a.removeEventListener(\"dragstart\",this.Lh,!1,this),a.removeEventListener(\"drag\",this.$j,!1,this),a.removeEventListener(\"dragend\",this.Kh,!1,this),a.removeEventListener(\"wheel\",this.pk,!1,this),a.removeEventListener(\"dbltap\",this.jk,!1,this),a.removeEventListener(\"pointermove\",this.ak,!1,this),this.a=null);this.f&&(this.f.style.msTouchAction=\"\",we(this.f,\"contextmenu\",this.Zj,!1,this),this.f=null);this.i=this.c=null;Uq.splice(Uq.indexOf(this.j),1);Ac.prototype.F.call(this)};\nTq.prototype.dispose=Tq.prototype.F;u(\"H.mapevents.buildInfo\",function(){return qf(\"mapsjs-mapevents\",\"1.8.1\",\"3dcce55\")});\n");