").addClass("track-info").appendTo(a);$("| ").html((this.info.zmin||"Zmin")+': ').appendTo(n),$(" | ").html((this.info.zmax||"Zmax")+': ').appendTo(n),$(" | ").html((this.info.distance||"Distance")+': ').appendTo(n),$(" | ").html((this.info.time||"Time")+': ').appendTo(n),n=$("").addClass("point-info").appendTo(a),$("| ").html((this.info.altitude||"Altitude")+': ').appendTo(n),$(" | ").html((this.info.distance||"Distance")+': ').appendTo(n),$(" | ").html((this.info.time||"Time")+': ').appendTo(n),this.tab_=[],e.feature&&this.setGeometry(e.feature)},ol.inherits(ol.control.Profil,ol.control.Control),ol.control.Profil.prototype.info={zmin:"Zmin",zmax:"Zmax",ytitle:"Altitude (m)",xtitle:"Distance (km)",time:"Time",altitude:"Altitude",distance:"Distance"},ol.control.Profil.prototype.popup=function(t){this.popup_.html(t)},ol.control.Profil.prototype.onMove=function(t){if(this.tab_.length){var e=$(this.canvas_).offset(),o=t.pageX-e.left,i=t.pageY-e.top,r=this.ratio;if(o>this.margin_.left/r&&o<(this.canvas_.width-this.margin_.right)/r&&i>this.margin_.top/r&&i<(this.canvas_.height-this.margin_.bottom)/r){this.bar_.css("left",o+"px").show();for(var s,a=(o*r-this.margin_.left)/this.scale_[0],n=this.tab_[0],l=1;s=this.tab_[l];l++)if(s[0]>=a){a<(s[0]+n[0])/2&&(s=n);break}s?this.cursor_.css({left:o+"px",top:(this.canvas_.height-this.margin_.bottom+s[1]*this.scale_[1]+this.dy_)/r+"px"}).show():this.cursor_.hide(),this.bar_.parent().addClass("over"),$(".point-info .z",this.element).text(s[1]+"m"),$(".point-info .dist",this.element).text((s[0]/1e3).toFixed(1)+"km"),$(".point-info .time",this.element).text(s[2]),o>this.canvas_.width/r/2?this.popup_.addClass("ol-left"):this.popup_.removeClass("ol-left"),this.dispatchEvent({type:"over",click:"click"==t.type,coord:s[3],time:s[2],distance:s[0]})}else this.bar_.parent().hasClass("over")&&(this.bar_.hide(),this.cursor_.hide(),this.bar_.parent().removeClass("over"),this.dispatchEvent({type:"out"}))}},ol.control.Profil.prototype.show=function(){$(this.element).removeClass("ol-collapsed"),this.dispatchEvent({type:"show",show:!0})},ol.control.Profil.prototype.hide=function(){$(this.element).addClass("ol-collapsed"),this.dispatchEvent({type:"show",show:!1})},ol.control.Profil.prototype.toggle=function(){var t=$(this.element).toggleClass("ol-collapsed").hasClass("ol-collapsed");this.dispatchEvent({type:"show",show:!t})},ol.control.Profil.prototype.isShown=function(){return!$(this.element).hasClass("ol-collapsed")},ol.control.Profil.prototype.setGeometry=function(t,e){e||(e={}),t instanceof ol.Feature&&(t=t.getGeometry());var o=this.canvas_,i=o.getContext("2d"),r=o.width,s=o.height;if(i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,r,s),/Z/.test(t.getLayout())){/M/.test(t.getLayout())?$(".time",this.element).parent().show():$(".time",this.element).parent().hide();var a=t.getCoordinates();switch(t.getType()){case"LineString":break;case"MultiLineString":a=a[0];break;default:return}var n=new ol.Sphere(6378137),l=e.projection||this.getMap().getView().getProjection();i.setTransform(1,0,0,1,this.margin_.left,s-this.margin_.bottom);var h=this.ratio;r-=this.margin_.right+this.margin_.left,s-=this.margin_.top+this.margin_.bottom,i.strokeStyle="#000",i.lineWidth=.5*h,i.beginPath(),i.moveTo(0,0),i.lineTo(0,-s),i.moveTo(0,0),i.lineTo(r,0),i.stroke();for(var c,p,u,g,d,f=1/0,y=-1/0,m=this.tab_=[],v=0;k=a[v];v++)(p=k[2])y&&(y=p),0==v?c=0:c+=(g=a[v-1],d=k,n.haversineDistance(ol.proj.transform(g,l,"EPSG:4326"),ol.proj.transform(d,l,"EPSG:4326"))),u=P(a[0][3],k[3]),m.push([c,p,u,k]);$(".track-info .zmin",this.element).text(f.toFixed(2)+"m"),$(".track-info .zmax",this.element).text(y.toFixed(2)+"m"),c>1e3?$(".track-info .dist",this.element).text((c/1e3).toFixed(1)+"km"):$(".track-info .dist",this.element).text(c.toFixed(1)+"m"),$(".track-info .time",this.element).text(u);for(var w=e.graduation||100;;){if(!(s/(((y=Math.ceil(y/w)*w)-(f=Math.floor(f/w)*w))/w)<15*h))break;w*=2}"number"==typeof e.zmin&&f>e.zmin&&(f=e.zmin),"number"==typeof e.zmax&&y1e3?(b=100*Math.round(c/1e3))>1e3&&(b=1e3*Math.ceil(b/1e3)):(A="m",b=c>100?10*Math.round(c/100):c>10?Math.round(c/10):c>1?Math.round(c)/10:c);for(v=0;v<=c;v+=b){var M="m"==A?v:v/1e3;i.fillText(Math.round(10*M)/10,v*S,4*h),i.moveTo(v*S,2*h),i.lineTo(v*S,0)}i.font=12*h+"px arial",i.fillText(this.info.xtitle.replace("(km)","("+A+")"),r/2,18*h),i.save(),i.rotate(-Math.PI/2),i.fillText(this.info.ytitle,s/2,-this.margin_.left),i.restore(),i.stroke(),i.strokeStyle="#369",i.lineWidth=1,i.setLineDash([]),i.beginPath();var k;for(v=0;k=m[v];v++)0==v?i.moveTo(k[0]*S,k[1]*x+C):i.lineTo(k[0]*S,k[1]*x+C);i.stroke()}function P(t,e){if(!t||!e)return"-";var o=(e-t)/60,i=Math.trunc(o/60),r=Math.trunc(o-60*i);return i+"h"+(r<10?"0":"")+r+"mn"}},ol.control.Profil.prototype.getImage=function(t,e){return"canvas"===t?this.canvas_:this.canvas_.toDataURL(t,e)},ol.control.SearchBAN=function(t){(t=t||{}).typing=t.typing||500,t.url=t.url||"https://api-adresse.data.gouv.fr/search/",ol.control.SearchPhoton.call(this,t),this.set("copy","© BAN-data.gouv.fr")},ol.inherits(ol.control.SearchBAN,ol.control.SearchPhoton),ol.control.SearchBAN.prototype.getTitle=function(t){return t.properties.label},ol.control.SearchBAN.prototype.select=function(t){var e=t.geometry.coordinates;try{e=ol.proj.transform(t.geometry.coordinates,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}this.dispatchEvent({type:"select",search:t,coordinate:e})},ol.control.SearchFeature=function(t){t||(t={}),ol.control.Search.call(this,t),"function"==typeof t.getSearchString&&(this.getSearchString=t.getSearchString),this.set("property",t.property||"name"),this.source_=t.source},ol.inherits(ol.control.SearchFeature,ol.control.Search),ol.control.SearchFeature.prototype.getTitle=function(t){return t.get(this.get("property")||"name")},ol.control.SearchFeature.prototype.getSearchString=function(t){return this.getTitle(t)},ol.control.SearchFeature.prototype.autocomplete=function(t){var e=[];t=t.replace(/^\*/,"");for(var o,i=new RegExp(t,"i"),r=this.source_.getFeatures(),s=this.get("maxItems"),a=0;(o=r[a])&&!(i.test(this.getSearchString(o))&&(e.push(o),--s<=0));a++);return e},ol.control.SearchNominatim=function(t){(t=t||{}).typing=t.typing||500,t.url=t.url||"https://nominatim.openstreetmap.org/search",ol.control.SearchJSON.call(this,t),this.set("copy","© OpenStreetMap contributors"),this.set("polygon",t.polygon)},ol.inherits(ol.control.SearchNominatim,ol.control.SearchJSON),ol.control.SearchNominatim.prototype.getTitle=function(t){var e=t.display_name+""+t.class+" - "+t.type+"";return t.icon&&(e=" "+e),e},ol.control.SearchNominatim.prototype.requestData=function(t){return{format:"json",addressdetails:1,q:t,polygon_geojson:this.get("polygon")?1:0,limit:this.get("maxItems")}},ol.control.SearchNominatim.prototype.select=function(t){var e=[Number(t.lon),Number(t.lat)];try{e=ol.proj.transform(e,"EPSG:4326",this.getMap().getView().getProjection())}catch(t){}this.dispatchEvent({type:"select",search:t,coordinate:e})},ol.control.Swipe=function(t){var e=t||{},o=document.createElement("button"),i=document.createElement("div");i.className=(e.className||"ol-swipe")+" ol-unselectable ol-control",i.appendChild(o),$(i).on("mousedown touchstart",this,this.move),ol.control.Control.call(this,{element:i}),this.layers=[],e.layers&&this.addLayer(e.layers,!1),e.rightLayers&&this.addLayer(e.rightLayers,!0),this.on("propertychange",function(){this.getMap()&&this.getMap().renderSync(),"horizontal"===this.get("orientation")?($(this.element).css("top",100*this.get("position")+"%"),$(this.element).css("left","")):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),$(this.element).css("left",100*this.get("position")+"%"),$(this.element).css("top","")),$(this.element).removeClass("horizontal vertical"),$(this.element).addClass(this.get("orientation"))},this),this.set("position",e.position||.5),this.set("orientation",e.orientation||"vertical")},ol.inherits(ol.control.Swipe,ol.control.Control),ol.control.Swipe.prototype.setMap=function(t){if(this.getMap()){for(var e=0;e=0&&this.getMap()&&(this.layers[o].right?t[e].un("precompose",this.precomposeRight,this):t[e].un("precompose",this.precomposeLeft,this),t[e].un("postcompose",this.postcompose,this),this.layers.splice(o,1),this.getMap().renderSync())}},ol.control.Swipe.prototype.move=function(t){var e=t.data;switch(t.type){case"touchcancel":case"touchend":case"mouseup":e.isMoving=!1,$(document).off("mouseup mousemove touchend touchcancel touchmove",e.move);break;case"mousedown":case"touchstart":e.isMoving=!0,$(document).on("mouseup mousemove touchend touchcancel touchmove",e,e.move);case"mousemove":case"touchmove":if(e.isMoving)if("vertical"===e.get("orientation")){var o=t.pageX||t.originalEvent.touches&&t.originalEvent.touches.length&&t.originalEvent.touches[0].pageX||t.originalEvent.changedTouches&&t.originalEvent.changedTouches.length&&t.originalEvent.changedTouches[0].pageX;if(!o)break;o-=$(e.getMap().getTargetElement()).offset().left;var i=e.getMap().getSize()[0];i=Math.min(Math.max(0,1-(i-o)/i),1),e.set("position",i)}else{var r=t.pageY||t.originalEvent.touches&&t.originalEvent.touches.length&&t.originalEvent.touches[0].pageY||t.originalEvent.changedTouches&&t.originalEvent.changedTouches.length&&t.originalEvent.changedTouches[0].pageY;if(!r)break;r-=$(e.getMap().getTargetElement()).offset().top;i=e.getMap().getSize()[1];i=Math.min(Math.max(0,1-(i-r)/i),1),e.set("position",i)}}},ol.control.Swipe.prototype.precomposeLeft=function(t){var e=t.context,o=e.canvas;e.save(),e.beginPath(),"vertical"===this.get("orientation")?e.rect(0,0,o.width*this.get("position"),o.height):e.rect(0,0,o.width,o.height*this.get("position")),e.clip()},ol.control.Swipe.prototype.precomposeRight=function(t){var e=t.context,o=e.canvas;e.save(),e.beginPath(),"vertical"===this.get("orientation")?e.rect(o.width*this.get("position"),0,o.width,o.height):e.rect(0,o.height*this.get("position"),o.width,o.height),e.clip()},ol.control.Swipe.prototype.postcompose=function(t){t.context.restore()},ol.control.Target=function(t){t=t||{},this.style=t.style||[new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#fff",width:3})})}),new ol.style.Style({image:new ol.style.RegularShape({points:4,radius:11,radius1:0,radius2:0,snapToPixel:!0,stroke:new ol.style.Stroke({color:"#000",width:1})})})],this.style instanceof Array||(this.style=[this.style]),this.composite=t.composite||"";var e=document.createElement("div");e.className="ol-target ol-unselectable ol-control",ol.control.Control.call(this,{element:e,target:t.target}),this.setVisible(!1!==t.visible)},ol.inherits(ol.control.Target,ol.control.Control),ol.control.Target.prototype.setMap=function(t){this.getMap()&&(this.getMap().un("postcompose",this.drawTarget_,this),this.getVisible()&&this.getMap().renderSync()),ol.control.Control.prototype.setMap.call(this,t),t&&t.on("postcompose",this.drawTarget_,this)},ol.control.Target.prototype.setVisible=function(t){this.set("visible",t),this.getMap()&&this.getMap().renderSync()},ol.control.Target.prototype.getVisible=function(){return this.get("visible")},ol.control.Target.prototype.drawTarget_=function(t){if(this.getMap()&&this.getVisible()){var e=t.context,o=t.frameState.pixelRatio;e.save(),e.scale(o,o);var i=e.canvas.width/(2*o),r=e.canvas.height/(2*o),s=new ol.geom.Point(this.getMap().getCoordinateFromPixel([i,r]));this.composite&&(e.globalCompositeOperation=this.composite);for(var a=0;a=0?t.duration:0:1e3,this.fade_="function"==typeof t.fade?t.fade:null,this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:ol.easing.linear;t.revers?this.easing_=function(t){return 1-e(t)}:this.easing_=e,this.hiddenStyle=t.hiddenStyle,ol.Object.call(this)},ol.inherits(ol.featureAnimation,ol.Object),ol.featureAnimation.prototype.drawGeom_=function(t,e,o){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var i=t.style,r=0;r=0;n--)0===e[n].duration_&&e.splice(n,1);var l=0,h=0;function c(o){a.vectorContext=o.vectorContext,a.frameState=o.frameState,a.extent||(a.extent=o.frameState.extent,a.start=o.frameState.time,a.context=o.context),a.time=o.frameState.time-a.start,a.elapsed=a.time/e[h].duration_,a.elapsed>1&&(a.elapsed=1),e[h].animate(a)||(++l0&&(this.duration_=this.dist_/this.speed_)},ol.inherits(ol.featureAnimation.Path,ol.featureAnimation),ol.featureAnimation.Path.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,o,i,r,s,a=this.dist_*this.easing_(t.elapsed),n=0;o=this.path_[0];for(var l=1;l=a){var h=(a-n)/s;o=[e[0]+(o[0]-e[0])*h,e[1]+(o[1]-e[1])*h];break}n+=s}if(!1!==this.rotate_)for(var c=this.rotate_-Math.atan2(e[1]-o[1],e[0]-o[0]),p=0;h=t.style[p];p++)h.getImage()&&h.getImage().setRotation(c);return t.geom.setCoordinates(o),this.drawGeom_(t,t.geom),t.time<=this.duration_},ol.featureAnimation.Shake=function(t){t=t||{},ol.featureAnimation.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||6),this.horizontal_=t.horizontal},ol.inherits(ol.featureAnimation.Shake,ol.featureAnimation),ol.featureAnimation.Shake.prototype.animate=function(t){var e=t.geom.clone(),o=t.geom.clone(),i=this.easing_(t.elapsed);return i=Math.sin(this.bounce_*i)*this.amplitude_*(1-i)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(i,0),o.translate(i,0)):e.translate(0,i),this.drawGeom_(t,e,o),t.time<=this.duration_},ol.featureAnimation.Show=function(t){ol.featureAnimation.call(this,t)},ol.inherits(ol.featureAnimation.Show,ol.featureAnimation),ol.featureAnimation.Show.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_},ol.featureAnimation.Slide=function(t){t=t||{},this.speed_=t.speed||0,ol.featureAnimation.call(this,t),this.side_=t.side||"left"},ol.inherits(ol.featureAnimation.Slide,ol.featureAnimation),ol.featureAnimation.Slide.prototype.animate=function(t){t.time||("left"==this.side_?this.dx=t.extent[0]-t.bbox[2]:this.dx=t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_},ol.featureAnimation.Teleport=function(t){ol.featureAnimation.call(this,t)},ol.inherits(ol.featureAnimation.Teleport,ol.featureAnimation),ol.featureAnimation.Teleport.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var o=t.frameState.pixelRatio;t.context.globalAlpha=e,t.context.scale(e,1/e);var i=t.frameState.coordinateToPixelTransform,r=(1/e-1)*o*(i[0]*t.coord[0]+i[1]*t.coord[1]+i[4]),s=(e-1)*o*(i[2]*t.coord[0]+i[3]*t.coord[1]+i[5]);t.context.translate(r,s),this.drawGeom_(t,t.geom),t.context.restore()}return t.time<=this.duration_},ol.featureAnimation.Throw=function(t){t=t||{},ol.featureAnimation.call(this,t),this.speed_=t.speed||0,this.side_=t.side||"left"},ol.inherits(ol.featureAnimation.Throw,ol.featureAnimation),ol.featureAnimation.Throw.prototype.animate=function(t){var e,o;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],o=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],o=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+o*o)/this.speed_/t.frameState.viewState.resolution);var i=t.geom.clone(),r=t.geom.clone();return i.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),r.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,i,r),t.time<=this.duration_},ol.featureAnimation.Zoom=function(t){t=t||{},ol.featureAnimation.call(this,t),this.set("zoomout",t.zoomOut)},ol.inherits(ol.featureAnimation.Zoom,ol.featureAnimation),ol.featureAnimation.ZoomOut=function(t){(t=t||{}).zoomOut=!0,ol.featureAnimation.Zoom.call(this,t)},ol.inherits(ol.featureAnimation.ZoomOut,ol.featureAnimation.Zoom),ol.featureAnimation.Zoom.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);for(var o,i=t.style,r=[],s=0;s=0;r--)this.filters_[r]===i&&this.filters_.splice(r,1);i.precompose&&this.un("precompose",t,i),i.postcompose&&this.un("postcompose",e,i),i.un("propertychange",o,this),o.call(this)}ol.Map.prototype.addFilter=function(t){i.call(this,t)},ol.Map.prototype.removeFilter=function(t){r.call(this,t)},ol.Map.prototype.getFilters=function(){return this.filters_},ol.layer.Base.prototype.addFilter=function(t){i.call(this,t)},ol.layer.Base.prototype.removeFilter=function(t){r.call(this,t)},ol.layer.Base.prototype.getFilters=function(){return this.filters_}}(),ol.filter.Mask=function(t){if(t=t||{},ol.filter.Base.call(this,t),t.feature)switch(t.feature.getGeometry().getType()){case"Polygon":case"MultiPolygon":this.feature_=t.feature}this.set("inner",t.inner),this.fillColor_=t.fill&&ol.color.asString(t.fill.getColor())||"rgba(0,0,0,0.2)"},ol.inherits(ol.filter.Mask,ol.filter.Base),ol.filter.Mask.prototype.drawFeaturePath_=function(t,e){var o=t.context,i=o.canvas,r=t.frameState.pixelRatio,s=t.frameState.coordinateToPixelTransform;function a(t){return[(t[0]*s[0]+t[1]*s[1]+s[4])*r,(t[0]*s[2]+t[1]*s[3]+s[5])*r]}s||(s=t.frameState.coordinateToPixelMatrix,a=function(t){return[(t[0]*s[0]+t[1]*s[1]+s[12])*r,(t[0]*s[4]+t[1]*s[5]+s[13])*r]});var n=this.feature_.getGeometry().getCoordinates();"Polygon"==this.feature_.getGeometry().getType()&&(n=[n]),o.beginPath(),e&&(o.moveTo(0,0),o.lineTo(i.width,0),o.lineTo(i.width,i.height),o.lineTo(0,i.height),o.lineTo(0,0));for(var l=0;le[0]&&(o=e[0]),re[1]&&(i=e[1]),s0;n--)x=n*s/r[0]-(n==r[0]?e[0]*(r[1]%2)+o:0),y=a-e[1]*(n%2)-o,t.lineTo(x,y);for(n=r[1];n>0;n--)x=e[0]*(n%2)+o,y=n*a/r[1]-(n==r[1]?o:0),t.lineTo(x,y);t.closePath()},ol.filter.Fold.prototype.precompose=function(t){var e=t.context,o=e.canvas;this.get("fold"),o.width,o.height;e.save(),e.shadowColor="rgba(0,0,0,0.3)",e.shadowBlur=8,e.shadowOffsetX=2,e.shadowOffsetY=3,this.drawLine_(e,this.get("fsize"),this.get("margin")),e.fillStyle="#fff",e.fill(),e.strokeStyle="rgba(0,0,0,0.1)",e.stroke(),e.restore(),e.save(),this.drawLine_(e,this.get("fsize"),this.get("margin")+this.get("padding")),e.clip()},ol.filter.Fold.prototype.postcompose=function(t){var e=t.context,o=e.canvas;e.restore(),e.save(),this.drawLine_(e,this.get("fsize"),this.get("margin")),e.clip();var i=this.get("fold"),r=o.width/i[0],s=o.height/i[1],a=e.createRadialGradient(5*r/8,5*r/8,r/4,r/2,r/2,r);a.addColorStop(0,"transparent"),a.addColorStop(1,"rgba(0,0,0,0.2)"),e.fillStyle=a,e.scale(1,s/r);for(var n=0;n=0})),this.on("drawstart",this._startDrawing,this),this.on("drawend",this._finishDrawing,this)},ol.inherits(ol.interaction.DrawHole,ol.interaction.Draw),ol.interaction.DrawHole.prototype.setMap=function(t){this.getMap()&&this.getMap().removeInteraction(this._select),t&&t.addInteraction(this._select),ol.interaction.Draw.prototype.setMap.call(this,t)},ol.interaction.DrawHole.prototype.setActive=function(t){this._select.getFeatures().clear(),ol.interaction.Draw.prototype.setActive.call(this,t)},ol.interaction.DrawHole.prototype.removeLastPoint=function(){this._feature&&this._feature.getGeometry().getCoordinates()[0].length>2&&ol.interaction.Draw.prototype.removeLastPoint.call(this)},ol.interaction.DrawHole.prototype.getPolygon=function(){return this._select.getFeatures().item(0)},ol.interaction.DrawHole.prototype._startDrawing=function(t){var e=this.getMap(),o=this.layers_;this._feature=t.feature,coord=t.feature.getGeometry().getCoordinates()[0][0];var i=e.getFeaturesAtPixel(e.getPixelFromCoordinate(coord),{layerFilter:o}),r=null;(r=i?"Polygon"!==i[0].getGeometry().getType()?null:i[0].getGeometry().intersectsCoordinate(coord)?i[0]:null:null)?this._select.getFeatures().push(r):(this.setActive(!1),this.setActive(!0),this._select.getFeatures().clear())},ol.interaction.DrawHole.prototype._finishDrawing=function(t){var e=t.feature.getGeometry().getCoordinates()[0];e.length>3&&this.getPolygon().getGeometry().appendLinearRing(new ol.geom.LinearRing(e)),this._feature=null,this._select.getFeatures().clear()},ol.interaction.DrawHole.prototype._geometryFn=function(t,e){var o=t[0].pop();return this.getPolygon()&&!this.getPolygon().getGeometry().intersectsCoordinate(o)||(this.lastOKCoord=[o[0],o[1]]),t[0].push([this.lastOKCoord[0],this.lastOKCoord[1]]),e?e.setCoordinates([t[0].concat([t[0][0]])]):e=new ol.geom.Polygon(t),e},ol.interaction.DrawRegular=function(t){t||(t={});this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.maxCircleCoordinates_=t.maxCircleCoordinates||100,this.features_=t.features,this.source_=t.source,this.squareFn_=t.squareCondition,this.centeredFn_=t.centerCondition,this.canRotate_=!1!==t.canRotate,this.setSides(t.sides);var e=[255,255,255,1],o=[0,153,255,1],i=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})];this.sketch_=new ol.Collection,this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({features:this.sketch_,useSpatialIndex:!1}),name:"DrawRegular overlay",displayInLayerSwitcher:!1,style:t.style||i}),ol.interaction.Interaction.call(this,{handleEvent:this.handleEvent_})},ol.inherits(ol.interaction.DrawRegular,ol.interaction.Interaction),ol.interaction.DrawRegular.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),ol.interaction.Interaction.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},ol.interaction.DrawRegular.prototype.setActive=function(t){this.reset(),ol.interaction.Interaction.prototype.setActive.call(this,t)},ol.interaction.DrawRegular.prototype.reset=function(){this.overlayLayer_.getSource().clear(),this.started_=!1},ol.interaction.DrawRegular.prototype.setSides=function(t){t=parseInt(t),this.sides_=t>2?t:0},ol.interaction.DrawRegular.prototype.canRotate=function(t){return!0!==t&&!1!==t||(this.canRotate_=t),this.canRotate_},ol.interaction.DrawRegular.prototype.getSides=function(){return this.sides_},ol.interaction.DrawRegular.prototype.startAngle={default:Math.PI/2,3:-Math.PI/2,4:Math.PI/4},ol.interaction.DrawRegular.prototype.getGeom_=function(){if(this.overlayLayer_.getSource().clear(),!this.center_)return!1;var t;if(this.coord_){var e=this.center_,o=this.coord_;if(!this.sides_&&this.square_&&!this.centered_){e=[(o[0]+e[0])/2,(o[1]+e[1])/2];var r=[o[0]-e[0],o[1]-e[1]],s=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=new ol.geom.Circle(e,s,"XY"),n=this.getMap().getPixelFromCoordinate(e),l=Math.max(100,Math.abs(n[0]-this.coordPx_[0]),Math.abs(n[1]-this.coordPx_[1]));return l=Math.min(this.maxCircleCoordinates_,Math.round(l/3)),ol.geom.Polygon.fromCircle(a,l,0)}var h=this.canRotate_&&this.centered_&&this.square_;r=[o[0]-e[0],o[1]-e[1]];if(this.square_&&!h){var c=Math.max(Math.abs(r[0]),Math.abs(r[1]));o[0]=e[0]+(r[0]>0?c:-c),o[1]=e[1]+(r[1]>0?c:-c)}if((s=Math.sqrt(r[0]*r[0]+r[1]*r[1]))>0){var p;a=new ol.geom.Circle(e,s,"XY");if(p=h?Math.atan2(r[1],r[0]):this.startAngle[this.sides_]||this.startAngle.default,this.sides_)t=ol.geom.Polygon.fromCircle(a,this.sides_,p);else{n=this.getMap().getPixelFromCoordinate(this.center_),l=Math.max(100,Math.abs(n[0]-this.coordPx_[0]),Math.abs(n[1]-this.coordPx_[1]));l=Math.min(this.maxCircleCoordinates_,Math.round(l/(this.centered_?3:5))),t=ol.geom.Polygon.fromCircle(a,l,0)}if(h)return t;var u=t.getExtent(),g=((e=this.centered_?[2*this.center_[0]-this.coord_[0],2*this.center_[1]-this.coord_[1]]:this.center_)[0]-o[0])/(u[0]-u[2]),d=(e[1]-o[1])/(u[1]-u[3]);if(this.square_){var f=Math.min(Math.abs(g),Math.abs(d));g=Math.sign(g)*f,d=Math.sign(d)*f}var y=[e[0]-u[0]*g,e[1]-u[1]*d];return t.applyTransform(function(t,e,o){for(i=0;ithis.squaredClickTolerance_&&(this.handleMoveEvent_(t),this.lastEvent=t.type);break;default:if(this.lastEvent=t.type,this.started_&&"dblclick"===t.type)return!1}return!0},ol.interaction.DrawRegular.prototype.finishDrawing=function(){this.started_&&this.coord_&&this.end_({pixel:this.upPx_,coordinate:this.coord_})},ol.interaction.DrawRegular.prototype.handleMoveEvent_=function(t){if(this.started_){this.coord_=t.coordinate,this.coordPx_=t.pixel;var e=this.drawSketch_(t);this.dispatchEvent({type:"drawing",feature:e,pixel:t.pixel,startCoordinate:this.center_,coordinate:t.coordinate,square:this.square_,centered:this.centered_})}else this.drawPoint_(t.coordinate)},ol.interaction.DrawRegular.prototype.start_=function(t){if(this.started_)this.coord_=t.coordinate;else{this.started_=!0,this.center_=t.coordinate,this.coord_=null;var e=this.feature_=new ol.Feature;this.drawSketch_(t),this.dispatchEvent({type:"drawstart",feature:e,pixel:t.pixel,coordinate:t.coordinate})}},ol.interaction.DrawRegular.prototype.end_=function(t){if(this.coord_=t.coordinate,this.started_=!1,this.coord_&&this.center_[0]!=this.coord_[0]&&this.center_[1]!=this.coord_[1]){var e=this.feature_;e.setGeometry(this.getGeom_()),this.source_?this.source_.addFeature(e):this.features_&&this.features_.push(e),this.dispatchEvent({type:"drawend",feature:e,pixel:t.pixel,coordinate:t.coordinate,square:this.square_,centered:this.centered_})}else this.dispatchEvent({type:"drawcancel",feature:null,pixel:t.pixel,coordinate:t.coordinate,square:this.square_,centered:this.centered_});this.center_=this.coord_=null,this.drawSketch_()},ol.interaction.DrawTouch=function(t){(t=t||{}).handleEvent=function(t){if(this.get("tap"))switch(t.type){case"singleclick":this.addPoint();break;case"dblclick":return this.addPoint(),this.finishDrawing(),!1}return!0},ol.interaction.CenterTouch.call(this,t),this.typeGeom_=t.type,this.source_=t.source,this.set("tap",!1!==t.tap);var e=[255,255,255,1],o=[0,153,255,1],i=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})];this.overlay_=new ol.layer.Vector({source:new ol.source.Vector({useSpatialIndex:!1}),style:i}),this.geom_=[]},ol.inherits(ol.interaction.DrawTouch,ol.interaction.CenterTouch),ol.interaction.DrawTouch.prototype.setMap=function(t){this.getMap()&&this.getMap().un("postcompose",this.drawSketchLink_,this),ol.interaction.CenterTouch.prototype.setMap.call(this,t),this.overlay_.setMap(t),this.getMap()&&this.getMap().on("postcompose",this.drawSketchLink_,this)},ol.interaction.DrawTouch.prototype.startDrawing=function(){this.geom_=[],this.addPoint()},ol.interaction.DrawTouch.prototype.getGeometryType=function(){return this.typeGeom_},ol.interaction.DrawTouch.prototype.finishDrawing=function(){if(this.getMap()){var t;switch(this.typeGeom_){case"LineString":this.geom_.length>1&&(t=new ol.Feature(new ol.geom.LineString(this.geom_)));break;case"Polygon":this.geom_[this.geom_.length-1]!=this.geom_[0]&&this.geom_.push(this.geom_[0]),this.geom_.length>3&&(t=new ol.Feature(new ol.geom.Polygon([this.geom_])))}t&&this.source_.addFeature(t),this.geom_=[],this.drawSketch_()}},ol.interaction.DrawTouch.prototype.addPoint=function(){if(this.getMap())switch(this.geom_.push(this.getPosition()),this.typeGeom_){case"Point":var t=new ol.Feature(new ol.geom.Point(this.geom_.pop()));this.source_.addFeature(t);break;case"LineString":case"Polygon":this.drawSketch_()}},ol.interaction.DrawTouch.prototype.removeLastPoint=function(){this.getMap()&&(this.geom_.pop(),this.drawSketch_())},ol.interaction.DrawTouch.prototype.drawSketch_=function(){if(this.overlay_.getSource().clear(),this.geom_.length){var t;"Polygon"==this.typeGeom_&&(t=new ol.Feature(new ol.geom.Polygon([this.geom_])),this.overlay_.getSource().addFeature(t));var e=new ol.geom.LineString(this.geom_);t=new ol.Feature(e),this.overlay_.getSource().addFeature(t),t=new ol.Feature(new ol.geom.Point(this.geom_.slice(-1).pop())),this.overlay_.getSource().addFeature(t)}},ol.interaction.DrawTouch.prototype.drawSketchLink_=function(t){if(this.getActive()&&this.getPosition()){var e=t.context;e.save();var o,i=this.getMap().getPixelFromCoordinate(this.getPosition()),r=t.frameState.pixelRatio||1;e.scale(r,r),e.strokeStyle="rgba(0, 153, 255, 1)",e.lineWidth=1,e.beginPath(),e.arc(i[0],i[1],5,0,2*Math.PI),e.stroke(),this.geom_.length&&(o=this.getMap().getPixelFromCoordinate(this.geom_[this.geom_.length-1]),e.beginPath(),e.moveTo(o[0],o[1]),e.lineTo(i[0],i[1]),"Polygon"==this.typeGeom_&&(o=this.getMap().getPixelFromCoordinate(this.geom_[0]),e.lineTo(o[0],o[1])),e.stroke()),e.restore()}},ol.interaction.DrawTouch.prototype.setActive=function(t){ol.interaction.CenterTouch.prototype.setActive.call(this,t),t||(this.geom_=[]),this.drawSketch_()},ol.interaction.DropFile=function(t){t=t||{},ol.interaction.DragAndDrop.call(this,{});var e=t.zone||document;$(e).on("dragenter",this.onstop),$(e).on("dragover",this.onstop),$(e).on("dragleave",this.onstop),this.formatConstructors_=t.formatConstructors||[ol.format.GPX,ol.format.GeoJSON,ol.format.IGC,ol.format.KML,ol.format.TopoJSON],this.projection_=t.projection,this.accept_=t.accept||["gpx","json","geojson","igc","kml","topojson"];var o=this;$(e).on("drop",function(t){return o.ondrop(t.originalEvent)})},ol.inherits(ol.interaction.DropFile,ol.interaction.DragAndDrop),ol.interaction.DropFile.prototype.setMap=function(t){ol.interaction.Interaction.prototype.setMap.call(this,t)},ol.interaction.DropFile.prototype.onstop=function(t){return t.preventDefault(),t.stopPropagation(),!1},ol.interaction.DropFile.prototype.ondrop=function(t){if(t.dataTransfer&&t.dataTransfer.files.length){var e=this;t.preventDefault(),t.stopPropagation();for(var o,i=t.dataTransfer.files,r=/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/,s=0;o=i[s];s++){var a=o.name.match(r)[0];e.dispatchEvent({type:"loadstart",file:o,filesize:o.size,filetype:o.type,fileextension:a,projection:l,target:e}),features=[];var n=new FileReader,l=this.projection_||this.getMap().getView().getProjection(),h=this.formatConstructors_;if(!l)return;function c(t,e,o){try{return t.readFeatures(e,o)}catch(t){}}var p=o;n.onload=function(t){var o,i,r=t.target.result,s=[];for(o=0,i=h.length;o0)return e.dispatchEvent({type:"addfeatures",features:s,file:p,projection:l,target:e}),void e.dispatchEvent({type:"loadend",features:s,file:p,projection:l,target:e})}e.dispatchEvent({type:"loadend",file:p,target:e})},n.readAsText(o)}}return!1},ol.interaction.Flashlight=function(t){ol.interaction.Pointer.call(this,{handleDownEvent:this.setPosition,handleMoveEvent:this.setPosition}),t=t||{},this.pos=!1,this.radius=t.radius||100,this.setColor(t)},ol.inherits(ol.interaction.Flashlight,ol.interaction.Pointer),ol.interaction.Flashlight.prototype.setMap=function(t){this.getMap()&&(this.getMap().un("postcompose",this.postcompose_,this),this.getMap().render()),ol.interaction.Pointer.prototype.setMap.call(this,t),t&&t.on("postcompose",this.postcompose_,this)},ol.interaction.Flashlight.prototype.setRadius=function(t){this.radius=t,this.getMap()&&this.getMap().renderSync()},ol.interaction.Flashlight.prototype.setColor=function(t){var e=t.fill?t.fill:[0,0,0,.8],o=ol.color.asArray(e);this.startColor=ol.color.asString(o),t.color?o=this.endColor=ol.color.asString(ol.color.asArray(t.color)||t.color):(o[3]=0,this.endColor=ol.color.asString(o)),o[3]=.1,this.midColor=ol.color.asString(o),this.getMap()&&this.getMap().renderSync()},ol.interaction.Flashlight.prototype.setPosition=function(t){t.pixel?this.pos=t.pixel:this.pos=t,this.getMap()&&this.getMap().renderSync()},ol.interaction.Flashlight.prototype.postcompose_=function(t){var e=t.context,o=t.frameState.pixelRatio,i=e.canvas.width,r=e.canvas.height;if(e.save(),e.scale(o,o),this.pos){var s=Math.max(i,r),a=e.createRadialGradient(this.pos[0],this.pos[1],i*this.radius/s,this.pos[0],this.pos[1],r*this.radius/s);a.addColorStop(0,this.startColor),a.addColorStop(.8,this.midColor),a.addColorStop(1,this.endColor),e.fillStyle=a,e.fillRect(this.pos[0]-s,this.pos[1]-s,2*s,2*s)}else e.fillStyle=this.startColor,e.fillRect(0,0,i,r);e.restore()},ol.interaction.GeolocationDraw=function(t){t||(t={});this.geolocation=new ol.Geolocation({projection:"EPSG:4326",trackingOptions:{maximumAge:1e4,enableHighAccuracy:!0,timeout:6e5}});this.geolocation.on("change",this.draw_,this),this.path_=[],this.lastPosition_=!1;var e=[255,255,255,1],o=[0,153,255,1],i=new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),r=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({stroke:new ol.style.Stroke({color:o,width:3}),fill:new ol.style.Fill({color:[255,255,255,.5]})})],s=new ol.style.RegularShape({radius:10.5,points:3,rotation:0,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),a=s.getImage(),n=a.getContext("2d"),l=document.createElement("canvas");l.width=l.height=a.width,l.getContext("2d").drawImage(a,0,0),n.clearRect(0,0,a.width,a.height),n.drawImage(l,0,0,a.width,a.height,3,0,a.width-6,a.height);this.locStyle={error:new ol.style.Style({fill:new ol.style.Fill({color:[255,0,0,.2]})}),warn:new ol.style.Style({fill:new ol.style.Fill({color:[255,192,0,.2]})}),ok:new ol.style.Style({fill:new ol.style.Fill({color:[0,255,0,.2]})})},this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector,name:"GeolocationDraw overlay",style:t.style||function(t){return void 0===t.get("heading")?r[1].setImage(i):(r[1].setImage(s),s.setRotation(t.get("heading")||0)),r}}),this.sketch_=[new ol.Feature,new ol.Feature,new ol.Feature],this.overlayLayer_.getSource().addFeatures(this.sketch_),this.features_=t.features,this.source_=t.source,this.condition_=t.condition||function(t){return t.getAccuracy()1?((n=new ol.geom.LineString(this.path_,"XYZM")).simplify(this.get("tolerance")),l.setGeometry(n)):l.setGeometry();break;case"Polygon":this.path_.length>2?((n=new ol.geom.Polygon([this.path_],"XYZM")).simplify(this.get("tolerance")),l.setGeometry(n)):l.setGeometry()}this.dispatchEvent({type:"drawing",feature:this.sketch_[1],geolocation:o})}this.sketch_[2].setGeometry(new ol.geom.Point(r)),this.sketch_[2].set("heading",o.getHeading()),this.dispatchEvent({type:"tracking",feature:this.sketch_[1],geolocation:o})}},ol.interaction.Hover=function(t){t||(t={});var e=this;ol.interaction.Interaction.call(this,{handleEvent:function(o){return"pointermove"==o.type&&e.handleMove_(o),!t.handleEvent||t.handleEvent(o)}}),this.setFeatureFilter(t.featureFilter),this.setLayerFilter(t.layerFilter),this.setCursor(t.cursor)},ol.inherits(ol.interaction.Hover,ol.interaction.Interaction),ol.interaction.Hover.prototype.setMap=function(t){void 0!==this.previousCursor_&&this.getMap()&&(this.getMap().getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=void 0),ol.interaction.Interaction.prototype.setMap.call(this,t)},ol.interaction.Hover.prototype.setCursor=function(t){!t&&void 0!==this.previousCursor_&&this.getMap()&&(this.getMap().getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=void 0),this.cursor_=t},ol.interaction.Hover.prototype.setFeatureFilter=function(t){this.featureFilter_="function"==typeof t?t:function(){return!0}},ol.interaction.Hover.prototype.setLayerFilter=function(t){this.layerFilter_="function"==typeof t?t:function(){return!0}},ol.interaction.Hover.prototype.handleMove_=function(t){var e=this.getMap();if(e){var o,i,r=this,s=e.forEachFeatureAtPixel(t.pixel,function(t,e){return r.layerFilter_.call(null,e)&&r.featureFilter_.call(null,t,e)?(o=t,i=e,!0):(o=i=null,!1)});if(s&&this.dispatchEvent({type:"hover",feature:o,layer:i,coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging}),this.feature_===o&&this.layer_===i||(this.feature_=o,this.layer_=i,o?this.dispatchEvent({type:"enter",feature:o,layer:i,coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging}):this.dispatchEvent({type:"leave",coordinate:t.coordinate,pixel:t.pixel,map:t.map,dragging:t.dragging})),this.cursor_){var a=e.getTargetElement().style;s?a.cursor!=this.cursor_&&(this.previousCursor_=a.cursor,a.cursor=this.cursor_):void 0!==this.previousCursor_&&(a.cursor=this.previousCursor_,this.previousCursor_=void 0)}}},ol.interaction.LongTouch=function(t){t||(t={}),this.delay_=t.delay||1e3;var e=t.handleLongTouchEvent||function(){},o=null;ol.interaction.Interaction.call(this,{handleEvent:function(t){if(this.getActive())switch(t.type){case"pointerdown":o&&clearTimeout(o),o=setTimeout(function(){t.type="longtouch",e(t)},this.delay_);break;case"pointerdrag":case"pointerup":o&&(clearTimeout(o),o=null)}else o&&(clearTimeout(o),o=null);return!0}})},ol.inherits(ol.interaction.LongTouch,ol.interaction.Interaction),ol.interaction.Offset=function(t){t||(t={}),ol.interaction.Pointer.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this.set("duplicate",t.duplicate),this.source_=t.source,this.previousCursor_=!1},ol.inherits(ol.interaction.Offset,ol.interaction.Pointer),ol.interaction.Offset.prototype.setMap=function(t){ol.interaction.Pointer.prototype.setMap.call(this,t)},ol.interaction.Offset.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t.pixel,function(o,i){var r;if(e.layers_){for(var s=0;s1)return!1;var n=r.getGeometry().getClosestPoint(t.coordinate),l=n[0]-t.coordinate[0],h=n[1]-t.coordinate[1];return Math.sqrt(l*l+h*h)/t.frameState.viewState.resolution<5&&{feature:r,hit:n,coordinates:r.getGeometry().getCoordinates(),geom:r.getGeometry().clone(),geomType:a}}return!1},{hitTolerance:5})},ol.interaction.Offset.prototype.handleDownEvent_=function(t){return this.current_=this.getFeatureAtPixel_(t),this.source_&&(this.get("duplicate")||t.originalEvent.ctrlKey)&&(this.current_.feature=this.current_.feature.clone(),this.source_.addFeature(this.current_.feature)),!!this.current_&&(this.dispatchEvent({type:"offsetstart",feature:this.current_.feature,offset:0}),!0)},ol.interaction.Offset.prototype.handleDragEvent_=function(t){var e=this.current_.geom.getClosestPoint(t.coordinate),o=ol.coordinate.dist2d(e,t.coordinate);switch(this.current_.geomType){case"Polygon":if(n=ol.coordinate.findSegment(e,this.current_.coordinates[0]).segment){var i=[n[1][0]-n[0][0],n[1][1]-n[0][1]],r=[t.coordinate[0]-e[0],t.coordinate[1]-e[1]];i[0]*r[1]-i[1]*r[0]>0&&(o=-o);for(var s=[],a=0;a0&&(o=-o);s=ol.coordinate.offsetCoords(this.current_.coordinates,o);this.current_.feature.setGeometry(new ol.geom.LineString(s))}}this.dispatchEvent({type:"offsetting",feature:this.current_.feature,offset:o,segment:[e,t.coordinate],coordinate:t.coordinate})},ol.interaction.Offset.prototype.handleUpEvent_=function(t){this.dispatchEvent({type:"offsetend",feature:this.current_.feature,coordinate:t.coordinate}),this.current_=!1},ol.interaction.Offset.prototype.handleMoveEvent_=function(t){this.getFeatureAtPixel_(t)?(!1===this.previousCursor_&&(this.previousCursor_=t.map.getTargetElement().style.cursor),t.map.getTargetElement().style.cursor="pointer"):(t.map.getTargetElement().style.cursor=this.previousCursor_,this.previousCursor_=!1)},ol.interaction.Ripple=function(t){ol.interaction.Pointer.call(this,{handleDownEvent:this.rainDrop,handleMoveEvent:this.rainDrop}),t=t||{},this.riprad=t.radius||3,this.ripplemap=[],this.last_map=[],this.interval=t.interval,this.rains(this.interval)},ol.inherits(ol.interaction.Ripple,ol.interaction.Pointer),ol.interaction.Ripple.prototype.setMap=function(t){this.oncompose&&(ol.Observable.unByKey(oncompose),this.getMap()&&this.getMap().render()),ol.interaction.Pointer.prototype.setMap.call(this,t),t&&(this.oncompose=t.on("postcompose",this.postcompose_,this))},ol.interaction.Ripple.prototype.rains=function(t){this.onrain&&clearTimeout(this.onrain);var e=this;vdelay=("number"==typeof t?t:1e3)/2,delay=3*vdelay/2;var o=Math.random;delay&&function t(){e.width&&e.rainDrop([o()*e.width,o()*e.height]),e.onrain=setTimeout(t,o()*vdelay+delay)}()},ol.interaction.Ripple.prototype.rainDrop=function(t){if(this.width){var e,o;t.pixel?(e=t.pixel[0]*this.ratio,o=t.pixel[1]*this.ratio):(e=t[0]*this.ratio,o=t[1]*this.ratio),e<<=0;for(var i=(o<<=0)-this.riprad*this.ratio;i>1,this.half_height=this.height>>1,this.size=this.width*(this.height+2)*2,this.oldind=this.width,this.newind=this.width*(this.height+3);for(var l=0;l>1,i-=this.ripplemap[d],i-=i>>5,this.ripplemap[d]=i,i=1024-i,this.last_map[l]!=i&&(this.last_map[l]=i,e=((g-this.half_width)*i/1024<<0)+this.half_width,o=((u-this.half_height)*i/1024<<0)+this.half_height,e>=this.width&&(e=this.width-1),e<0&&(e=0),o>=this.height&&(o=this.height-1),o<0&&(o=0),s=4*(e+o*this.width),c[r=4*l]=p[s],c[r+1]=p[s+1],c[r+2]=p[s+2]),++l}a.putImageData(this.ripple,0,0),this.getMap().render()},ol.interaction.SelectCluster=function(t){t=t||{},this.pointRadius=t.pointRadius||12,this.circleMaxObjects=t.circleMaxObjects||10,this.maxObjects=t.maxObjects||60,this.spiral=!1!==t.spiral,this.animate=t.animate,this.animationDuration=t.animationDuration||500,this.selectCluster_=!1!==t.selectCluster;var e=this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});if(t.layers)if("function"==typeof t.layers){var o=t.layers;t.layers=function(t){return t===e||o(t)}}else t.layers.push&&t.layers.push(this.overlayLayer_);if(t.filter){o=t.filter;t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))&&o(t,e)}}else t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter,ol.interaction.Select.call(this,t),this.on("select",this.selectCluster,this)},ol.inherits(ol.interaction.SelectCluster,ol.interaction.Select),ol.interaction.SelectCluster.prototype.setMap=function(t){this.getMap()&&(this.getMap().getView()&&this.getMap().getView().un("change:resolution",this.clear,this),this.getMap().removeLayer(this.overlayLayer_)),ol.interaction.Select.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),t&&t.getView()&&t.getView().on("change:resolution",this.clear,this)},ol.interaction.SelectCluster.prototype.clear=function(){this.getFeatures().clear(),this.overlayLayer_.getSource().clear()},ol.interaction.SelectCluster.prototype.getLayer=function(){return this.overlayLayer_},ol.interaction.SelectCluster.prototype.selectCluster=function(t){if(t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var o=this.overlayLayer_.getSource();o.clear();var i=e.get("features");if(i&&1!=i.length){this.selectCluster_||this.getFeatures().clear();var r=e.getGeometry().getCoordinates(),s=this.getMap().getView().getResolution(),a=s*this.pointRadius*(.5+i.length/4);if(!this.spiral||i.length<=this.circleMaxObjects)for(var n=Math.min(i.length,this.circleMaxObjects),l=0;l1)return ol.Observable.unByKey(this.listenerKey_),this.overlayLayer_.setVisible(!0),void this.overlayLayer_.changed();o.frameState.animate=!0},this)}},ol.interaction.SnapGuides=function(t){function e(t,e){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],r=e[1][0]-e[0][0],s=e[1][1]-e[0][1],a=o*s-i*r;if(0!=a){var n=(o*t[0][1]-o*e[0][1]-i*t[0][0]+i*e[0][0])/a;return[e[0][0]+n*r,e[0][1]+n*s]}return!1}function o(t,e){var o=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(o*o+i*i)}t||(t={}),this.snapDistance_=t.pixelTolerance||10;var i=[new ol.style.Style({stroke:new ol.style.Stroke({color:"#ffcc33",lineDash:[8,5],width:1.25})})];t.style&&(i=t.style instanceof Array?t.style:[t.style]),this.overlaySource_=new ol.source.Vector({features:new ol.Collection,useSpatialIndex:!1}),this.overlayLayer_=new ol.layer.Vector({source:this.overlaySource_,style:function(t){return i},name:"Snap overlay",displayInLayerSwitcher:!1}),ol.interaction.Interaction.call(this,{handleEvent:function(t){if(this.getActive()){for(var i,r=this.overlaySource_.getFeatures(),s=null,a=null,n=t.frameState.viewState.resolution,l=0;i=r[l];l++){var h=i.getGeometry().getClosestPoint(t.coordinate);if(o(h,t.coordinate)/n-1e8&&(r=e?[t[0][0]+a*n*h,t[0][1]-s*n*h]:[t[0][0]+s*n*h,t[0][1]+a*n*h],ol.extent.containsCoordinate(i,r));h-=1e5)l.push(r);var p=new ol.Feature(new ol.geom.LineString(l));return this.overlaySource_.addFeature(c),this.overlaySource_.addFeature(p),[c,p]}},ol.interaction.SnapGuides.prototype.addOrthoGuide=function(t){return this.addGuide(t,!0)},ol.interaction.SnapGuides.prototype.setDrawInteraction=function(t){var e=this,o=0,i=[];function r(t){var r=[],s=2;switch(t.target.getType()){case"LineString":r=t.target.getCoordinates(),s=2;break;case"Polygon":r=t.target.getCoordinates()[0],s=3}var a=r.length;a!=o&&a>s&&(e.clearGuides(i),i=(i=(i=e.addOrthoGuide([r[a-s],r[a-s-1]])).concat(e.addGuide([r[0],r[1]]))).concat(e.addOrthoGuide([r[0],r[1]])),o=a)}t.on("drawstart",function(t){t.feature.getGeometry().on("change",r)}),t.on("drawend",function(t){e.clearGuides(i),t.feature.getGeometry().un("change",r),o=0,i=[]})},ol.interaction.Split=function(t){t||(t={}),ol.interaction.Interaction.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}return!0}}),this.snapDistance_=t.snapDistance||25,this.tolerance_=t.tolerance||1e-10,this.cursor_=t.cursor,this.sources_=t.sources?t.sources instanceof Array?t.sources:[t.sources]:[],t.features&&this.sources_.push(new ol.source.Vector({features:features})),this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],o=[0,153,255,1],i=new ol.style.Fill({color:"rgba(255,255,255,0.4)"}),r=new ol.style.Stroke({color:"#3399CC",width:1.25}),s=[new ol.style.Style({image:new ol.style.Circle({fill:i,stroke:r,radius:5}),fill:i,stroke:r})],a=[new ol.style.Style({stroke:new ol.style.Stroke({color:e,width:5})}),new ol.style.Style({image:new ol.style.Circle({radius:6,fill:new ol.style.Fill({color:o}),stroke:new ol.style.Stroke({color:e,width:1.5})}),stroke:new ol.style.Stroke({color:o,width:3})})];t.sketchStyle&&(s=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]),t.featureStyle&&(a=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]),this.overlayLayer_=new ol.layer.Vector({source:new ol.source.Vector({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?s:a}})},ol.inherits(ol.interaction.Split,ol.interaction.Interaction),ol.interaction.Split.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),ol.interaction.Interaction.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},ol.interaction.Split.prototype.getClosestFeature=function(t){for(var e,o,i,r=this.snapDistance_+1,s=0;sthis.snapDistance_)return!1;var n=this.getNearestCoord(o,e.getGeometry().getCoordinates()),l=this.getMap().getPixelFromCoordinate(n);return ol.coordinate.dist2d(t.pixel,l)1){for(var i=[],r=0;r1)return!1;var h=((t[0][1]-e[1][1])*i-(t[0][0]-e[1][0])*s)/n;if(Math.abs(h)1)return!1;var c=t[0][0]*t[1][1]-t[0][1]*t[1][0],p=e[0][0]*e[1][1]-e[0][1]*e[1][0];return[(c*r-p*i)/n,(c*a-p*s)/n]},ol.interaction.Splitter.prototype.splitSource=function(t){if(!this.splitting){var e,o,i,r=this;this.source_.dispatchEvent({type:"beforesplit",feaure:t,source:this.source_}),this.splitting=!0,this.added_=[],this.removed_=[];var s,a=t.getGeometry().getCoordinates(),n=[];for(e=0;e1){for(o=0;o1))return c=e,!0}return!1}},ol.interaction.Splitter.prototype.onAddFeature=function(t){this.splitSource(t.feature),this.splitting&&this.added_.push(t.feature)},ol.interaction.Splitter.prototype.onRemoveFeature=function(t){if(this.splitting){var e=this.added_.indexOf(t.feature);-1==e?this.removed_.push(t.feature):this.added_.splice(e,1)}},ol.interaction.Splitter.prototype.onChangeFeature=function(t){this.moving_?this.lastEvent_=t:this.splitSource(t.feature)},ol.interaction.Synchronize=function(t){t||(t={});var e=this;ol.interaction.Interaction.call(this,{handleEvent:function(t){return"pointermove"==t.type&&e.handleMove_(t),!0}}),this.maps=t.maps},ol.inherits(ol.interaction.Synchronize,ol.interaction.Interaction),ol.interaction.Synchronize.prototype.setMap=function(t){if(this.getMap()&&(this.getMap().getView().un("change:center",this.syncMaps,this),this.getMap().getView().un("change:rotation",this.syncMaps,this),this.getMap().getView().un("change:resolution",this.syncMaps,this),ol.events.unlisten(this.getMap().getViewport(),ol.events.EventType.MOUSEOUT,this.handleMouseOut_,this)),ol.interaction.Interaction.prototype.setMap.call(this,t),t){this.getMap().getView().on("change:center",this.syncMaps,this),this.getMap().getView().on("change:rotation",this.syncMaps,this),this.getMap().getView().on("change:resolution",this.syncMaps,this);var e=this;$(this.getMap().getTargetElement()).mouseout(function(){for(var t=0;t").addClass("ol-target");this.targetOverlay_=new ol.Overlay({element:e.get(0)}),this.targetOverlay_.setPositioning("center-center"),this.addOverlay(this.targetOverlay_),e.parent().addClass("ol-target-overlay"),this.targetOverlay_.setPosition([0,0])}this.targetOverlay_.setPosition(t)},ol.Map.prototype.hideTarget=function(){this.removeOverlay(this.targetOverlay_),this.targetOverlay_=void 0},ol.interaction.TinkerBell=function(t){t=t||{},ol.interaction.Pointer.call(this,{handleDownEvent:this.onMove,handleMoveEvent:this.onMove}),this.set("color",t.color?ol.color.asString(t.color):"#fff"),this.sparkle=[0,0],this.sparkles=[],this.lastSparkle=this.time=new Date;var e=this;this.out_=function(){e.isout_=!0},this.isout_=!0},ol.inherits(ol.interaction.TinkerBell,ol.interaction.Pointer),ol.interaction.TinkerBell.prototype.setMap=function(t){this.getMap()&&(this.getMap().un("postcompose",this.postcompose_,this),t.getViewport().removeEventListener("mouseout",this.out_,!1),this.getMap().render()),ol.interaction.Pointer.prototype.setMap.call(this,t),t&&(t.on("postcompose",this.postcompose_,this),t.on("mouseout",this.onMove,this),t.getViewport().addEventListener("mouseout",this.out_,!1))},ol.interaction.TinkerBell.prototype.onMove=function(t){this.sparkle=t.pixel,this.isout_=!1,this.getMap().render()},ol.interaction.TinkerBell.prototype.postcompose_=function(t){var e=t.context,o=(e.canvas,t.frameState.time-this.time);this.time=t.frameState.time,t.frameState.time-this.lastSparkle>30&&!this.isout_&&(this.lastSparkle=t.frameState.time,this.sparkles.push({p:[this.sparkle[0]+15*Math.random()-7.5,this.sparkle[1]+15*Math.random()],o:1})),e.save(),e.scale(t.frameState.pixelRatio,t.frameState.pixelRatio),e.fillStyle=this.get("color");for(var i,r=this.sparkles.length-1;i=this.sparkles[r];r--){if(i.o<.2){this.sparkles.splice(0,r+1);break}e.globalAlpha=i.o,e.beginPath(),e.arc(i.p[0],i.p[1],2.2,0,2*Math.PI,!1),e.fill(),i.o*=.98,i.p[0]+=Math.random()-.5,i.p[1]+=o*(1+Math.random())/30}e.restore(),this.sparkles.length&&this.getMap().render()},ol.interaction.TouchCompass=function(t){t=t||{};var e={handleDownEvent:function(t){var e=this.getCenter_(),o=t.pixel[0]-e[0],i=t.pixel[1]-e[1];return this.start=t,Math.sqrt(o*o+i*i)DBpedia CC-by-SA"})]),e.strategy||(e.strategy=ol.loadingstrategy.bbox),ol.source.Vector.call(this,e)},ol.inherits(ol.source.DBPedia,ol.source.Vector),ol.source.DBPedia.prototype.readFeature=function(t,e,o){for(var i in e)t.set(i,e[i].value);return!o||o.get("subject")!=e.subject.value||(o.set("type",o.get("type")+"\n"+e.type.value),!1)},ol.source.DBPedia.prototype.querySubject=function(){return"?subject rdfs:label ?label. OPTIONAL {?subject dbpedia-owl:thumbnail ?thumbnail}.OPTIONAL {?subject dbpedia-owl:abstract ?abstract} . OPTIONAL {?subject rdf:type ?type}"},ol.source.DBPedia.prototype.queryFilter=function(){return"lang(?label) = '"+this._lang+"' && lang(?abstract) = '"+this._lang+"'"},ol.source.DBPedia.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=this,r=ol.proj.transformExtent(t,o,"EPSG:4326");query="PREFIX geo: SELECT DISTINCT * WHERE { ?subject geo:lat ?lat . ?subject geo:long ?long . "+this.querySubject()+" . FILTER("+this.queryFilter()+") . FILTER(xsd:float(?lat) <= "+r[3]+" && "+r[1]+" <= xsd:float(?lat) && xsd:float(?long) <= "+r[2]+" && "+r[0]+" <= xsd:float(?long) ) . } LIMIT "+this._limit,$.ajax({url:this._url,dataType:"jsonp",data:{query:query,format:"json"},success:function(t){var e,r,s,a=t.results.bindings,n=[],l=null;for(var h in a)e=a[h],r=[Number(a[h].long.value),Number(a[h].lat.value)],s=new ol.Feature(new ol.geom.Point(ol.proj.transform(r,"EPSG:4326",o))),i.readFeature(s,e,l)&&(n.push(s),l=s);i.addFeatures(n)}})}},function(){var t={};ol.style.clearDBPediaStyleCache=function(){t={}},ol.style.dbPediaStyleFunction=function(e){var o;switch(e||(e={}),typeof e.glyph){case"function":o=e.glyph;break;case"string":o=function(){return e.glyph};break;default:o=function(t){var e=t.get("type");if(e){if(e.match("/Museum"))return"fa-camera";if(e.match("/Monument"))return"fa-building";if(e.match("/Sculpture"))return"fa-android";if(e.match("/Religious"))return"fa-institution";if(e.match("/Castle"))return"fa-key";if(e.match("Water"))return"fa-tint";if(e.match("Island"))return"fa-leaf";if(e.match("/Event"))return"fa-heart";if(e.match("/Artwork"))return"fa-asterisk";if(e.match("/Stadium"))return"fa-futbol-o";if(e.match("/Place"))return"fa-street-view"}return"fa-star"}}var i=e.radius||8,r=e.fill||new ol.style.Fill({color:"navy"}),s=e.stroke||new ol.style.Stroke({color:"#fff",width:2}),a=e.prefix?e.prefix+"_":"";return function(e,n){var l=o(e),h=a+l,c=t[h];return c||(t[h]=c=new ol.style.Style({image:new ol.style.FontSymbol({glyph:l,radius:i,fill:r,stroke:s})})),[c]}}}(),ol.source.GeoImage=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this.center=t.imageCenter,this.scale=t.imageScale,this.rotate=t.imageRotate?t.imageRotate:0,this.crop=t.imageCrop,this.mask=t.imageMask,this._image=t.image?t.image:new Image,this._image.crossOrigin=t.crossOrigin;var o=this;this._image.onload=function(){o.setCrop(o.crop),o.changed()},t.image||(this._image.src=t.url),e.canvasFunction=function(t,e,o,i,r){var s=document.createElement("canvas");s.width=i[0],s.height=i[1];var a=s.getContext("2d");if(!this._imageSize)return s;function n(e){return[(e[0]-t[0])/(t[2]-t[0])*i[0],(e[1]-t[3])/(t[1]-t[3])*i[1]]}if(this.mask){a.beginPath();var l=n(this.mask[0]);a.moveTo(l[0],l[1]);for(var h=1;h-1)return{id:e,index:o};for(e in this._bin){var o;if((o=this._bin[e].get("features").indexOf(t))>-1)return{id:e,index:o,moved:!0}}return!1},ol.source.HexBin.prototype._onRemoveFeature=function(t,e){var o=t.feature||t.target,i=e||this.getBin(o);if(i){var r=this._bin[i.id].get("features");r.splice(i.index,1),r.length||(this.removeFeature(this._bin[i.id]),delete this._bin[i.id])}else console.log("[ERROR:HexBin] remove feature feature doesn't exists anymore.");o.un("change",this._onModifyFeature,this)},ol.source.HexBin.prototype._onModifyFeature=function(t){var e=this.getBin(t.target);e&&e.moved&&(this._onRemoveFeature(t,e),this._onAddFeature(t)),this.changed()},ol.source.HexBin.prototype.reset=function(){this._bin={},this.clear();for(var t,e=this._origin.getFeatures(),o=0;t=e[o];o++)this._onAddFeature({feature:t})},ol.source.HexBin.prototype.getSource=function(){return this._origin},ol.source.Mapillary=function(t){var e=t||{};e.loader=this._loaderFn,this._maxResolution=e.maxResolution||100,this._limit=e.limit||100,e.attributions||(e.attributions=[new ol.Attribution({html:"© Mapillary"})]),e.strategy||(e.strategy=ol.loadingstrategy.bbox),ol.source.Vector.call(this,e)},ol.inherits(ol.source.Mapillary,ol.source.Vector),ol.source.Mapillary.prototype.readFeature=function(t,e){return!0},ol.source.Mapillary.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=ol.proj.transformExtent(t,o,"EPSG:4326"),r=Date.now()-15552e6,s="https://a.mapillary.com/v2/search/im?client_id="+this.get("clientId")+"&max_lat="+i[3]+"&max_lon="+i[2]+"&min_lat="+i[1]+"&min_lon="+i[0]+"&limit="+(this._limit-1)+"&start_time="+r;$.ajax({url:s,dataType:"jsonp",success:function(t){console.log(t)}})}},ol.source.WikiCommons=function(t){var e=t||{};e.loader=this._loaderFn,this._maxResolution=e.maxResolution||100,this._lang=e.lang||"fr",this._limit=e.limit||100,e.attributions||(e.attributions=[new ol.Attribution({html:"© Wikimedia Commons"})]),e.strategy||(e.strategy=ol.loadingstrategy.bbox),ol.source.Vector.call(this,e)},ol.inherits(ol.source.WikiCommons,ol.source.Vector),ol.source.WikiCommons.prototype.readFeature=function(t,e){return t.set("descriptionurl",e.descriptionurl),t.set("url",e.url),t.set("title",e.title.replace(/^file:|.jpg$/gi,"")),t.set("thumbnail",e.url.replace(/^(.+wikipedia\/commons)\/([a-zA-Z0-9]\/[a-zA-Z0-9]{2})\/(.+)$/,"$1/thumb/$2/$3/200px-$3")),t.set("user",e.user),e.extmetadata&&e.extmetadata.LicenseShortName&&t.set("copy",e.extmetadata.LicenseShortName.value),!0},ol.source.WikiCommons.prototype._loaderFn=function(t,e,o){if(!(e>this._maxResolution)){var i=this,r=ol.proj.transformExtent(t,o,"EPSG:4326"),s="https://commons.wikimedia.org/w/api.php?action=query&format=json&origin=*&prop=coordinates|imageinfo&generator=geosearch&iiprop=timestamp|user|url|extmetadata|metadata|size&iiextmetadatafilter=LicenseShortName&ggsbbox="+r[3]+"|"+r[0]+"|"+r[1]+"|"+r[2]+"&ggslimit="+this._limit+"&iilimit="+(this._limit-1)+"&ggsnamespace=6";$.ajax({url:s,dataType:"jsonp",success:function(t){var e,r,s,a=[];if(t.query&&t.query.pages){for(var n in t.query.pages){if((e=t.query.pages[n]).coordinates&&e.coordinates.length)r=[e.coordinates[0].lon,e.coordinates[0].lat];else{var l=e.imageinfo[0].metadata;if(!l)continue;r=[];for(var h=0,c=0;c1e3)return void this.stopAnimation();r=i.start=(new Date).getTime()}if(i.start){var h=t.vectorContext,c=(r-i.start)/e;c>1&&(this.stopAnimation(),c=1),c=this.get("animationMethod")(c);var p=this.getStyle(),u="function"==typeof p?p:p.length?function(){return p}:function(){return[p]};t.context.save(),t.context.globalAlpha=this.getOpacity();var g,d=t.frameState.pixelRatio;for(n=0;g=i.clusters[n];n++){var f=g.f.getGeometry().getCoordinates(),y=f[0]-g.pt[0],m=f[1]-g.pt[1];i.revers?(f[0]=g.pt[0]+c*y,f[1]=g.pt[1]+c*m):(f[0]=f[0]-c*y,f[1]=f[1]-c*m);for(var v,w=u(g.f,o,!0),_=new ol.geom.Point(f),S=0;v=w[S];S++){var x,C=!ol.Map.prototype.getFeaturesAtPixel&&v.getImage();C&&(x=C.getScale(),C.setScale(x*d)),h.setStyle?1!==g.f.get("features").length||y||m?(h.setStyle(v),h.drawGeometry(_)):h.drawFeature(g.f.get("features")[0],v):(h.setImageStyle(C),h.setTextStyle(v.getText()),h.drawPointGeometry(_)),C&&C.setScale(x)}}t.context.restore(),t.frameState.animate=!0,t.context.save(),t.context.beginPath(),t.context.rect(0,0,0,0),t.context.clip(),this.clip_=!0}}},ol.layer.AnimatedCluster.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)},ol.source.Source.prototype.getPreview=function(t,e){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAk6QAAJOkBUCTn+AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANeSURBVHic7ZpPiE1RHMc/780MBhkik79JSUlIUbOxI+wkI2yRhYSUlJLNpJF/xcpiJBmZGBZsNM1CkmhKITGkGbH0/BuPmXnP4rxbb/TOn3fvOffeec6nfqvb/b7f93fveeec37ng8Xg8Ho/nf6Uu4d+fDswFssCvhHOJhaXAMeApMAQUyyIPPAdOAiuTStAVy4EHjDWsix5gdRLJ2mY34ulWYz6IEeA4kIk9awtkgTOEM/5vdAKT4k0/Ou3YMR/ELcbRm9AKFLBbgCJwNE4TYZkJfMG++SIwDCyLz0o4bI17WdyJz0r1TAZ+oDcxCBwAFgIzEIuhvcBbg3sLwOK4DFXLFvQGniCGSSUagS4DjUPOHESkA3XiOWCORqMR6Nfo9DjI3QqPUSd+ylBnv0Zn0GrWFvmIOvGNhjqrNDp/EAutyFgRKUM2tgO+Gur81FxvAKYZaimxXYBvmuuLDHWWaK4X0RfJCNsF6NdcbzXU2a65PohYFKWOc+jn8PUajbWIXaBKp9NB7lZYh34OzwFbFfd/NtDYYSth27urLGIm0M31AL3APWAAmIooymaDnPIl/Vz4NN1yHrd7gcvxWQnHAuA3bsyPop8hUsE13BSgK04TUViBeFo2zedJ8S6wElexW4D2eNOPTjNi6WvD/DtEr8E6tk6GGoAmxFY2iFHE9NZiQf8gogiB9gTEH23izAZuE77vHyU+ANucO1QwD3hD/MbLowAcdm20EmkwXx4n3NodS9rMB2HabYpEWs0HcRqHp0fNwAvJD+eBTZr7p6BvmQVxUaEzEbiruNfJekH15L8jtrEm7JJolEcOmKXRqQOuKDQuY7HZY8s8iNfzkSLxIuI43FTrkkLnOlBfRW4VsWk+oAX5weknxFAxJQNckGgVgZuIRVoomoGXEmGTMa+iQ6K7M4SW7k24QYgiuDQPYinbhugiF4H3RGtzZYCzyIvQXfpNI1ybLyeLpf5+iTbkRbiP2EcocTHm4+YI8iI8RFHwWjAfsA95Q+YZFU6wasl8wB7kReijtNbIILa0vcg/PRlGfPQwHmlCviDqAzaA+OREtzqr1ejOIDorxlNEjTGUBV4nnUWCvAJxGDlA8q9j3DEArAn2zvXAfOwfl6eVAmJrPpJ0Ih6Px+PxeJLjLwPul3vj5d0eAAAAAElFTkSuQmCC"},ol.source.Tile.prototype.getPreview=function(t,e){t||(t=[21020,6355964]),e||(e=150);var o=this.getTileGrid().getTileCoordForCoordAndResolution(t,e);return this.getTileUrlFunction().call(this,o,this.getProjection())},ol.source.TileWMS.prototype.getPreview=function(t,e){t||(t=[21020,6355964]),e||(e=150);var o=this.getGetFeatureInfoUrl(t,e,this.getProjection()||"EPSG:3857",{});return o=o.replace(/getfeatureinfo/i,"GetMap")},ol.layer.Layer.prototype.getPreview=function(t,e){if(this.get("preview"))return[this.get("preview")];if(e||(e=150),ethis.getMaxResolution()){var o=this.getMinResolution(),i=this.getMaxResolution();for(i>1e5&&(i=156543),o<.15&&(o=.15),e=i;i>o;)i/=2,e=o*=2}var r=this.getExtent();return t||(t=[21020,6355964]),r&&!ol.extent.containsCoordinate(r,t)&&(t=[(r[0]+r[2])/2,(r[1]+r[3])/2]),this.getSource?[this.getSource().getPreview(t,e)]:[]},ol.layer.Group.prototype.getPreview=function(t,e){if(this.get("preview"))return[this.get("preview")];var o=[];if(this.getLayers)for(var i=this.getLayers().getArray(),r=0;rthis.maxResolution_)){if(this.res_=400*e,this.animate_){var o=t.frameState.time-this.animate_;othis.animateDuration_&&(this.animate_=!1),!!this.animate_},ol.render3D.prototype.getFeatureHeight=function(t){if(this.animate_){var e=this.height_(t),o=this.toHeight_(t);return e*(1-this.elapsedRatio_)+this.elapsedRatio_*o}return this.height_(t)},ol.render3D.prototype.hvector_=function(t,e){return p0=[t[0]*this.matrix_[0]+t[1]*this.matrix_[1]+this.matrix_[4],t[0]*this.matrix_[2]+t[1]*this.matrix_[3]+this.matrix_[5]],p1=[p0[0]+e/this.res_*(p0[0]-this.center_[0]),p0[1]+e/this.res_*(p0[1]-this.center_[1])],{p0:p0,p1:p1}},ol.render3D.prototype.getFeature3D_=function(t,e){var o=t.getGeometry().getCoordinates();switch(t.getGeometry().getType()){case"Polygon":o=[o];case"MultiPolygon":for(var i=[],r=0;r=0;s--)t.lineTo(r[s].p1[0],r[s].p1[1])}t.closePath()}t.fill("evenodd"),t.stroke();break;case"Point":var n=(r=e[o]).feature.get("label"),l=r.geom.p1,h=t.fillStyle;t.fillStyle=t.strokeStyle,t.textAlign="center",t.textBaseline="bottom",t.fillText(n,l[0],l[1]);var c=t.measureText(n),p=Number(t.font.match(/\d+(\.\d+)?/g).join([]));t.fillStyle="rgba(255,255,255,0.5)",t.fillRect(l[0]-c.width/2-5,l[1]-p-5,c.width+10,p+10),t.strokeRect(l[0]-c.width/2-5,l[1]-p-5,c.width+10,p+10),t.fillStyle=h}},ol.Overlay.Magnify=function(t){var e=$("").addClass("ol-magnify");this._elt=e.get(0),ol.Overlay.call(this,{positioning:t.positioning||"center-center",element:this._elt,stopEvent:!1}),this.mgmap_=new ol.Map({controls:new ol.Collection,interactions:new ol.Collection,target:t.target||this._elt,view:new ol.View({projection:t.projection}),layers:t.layers}),this.mgview_=this.mgmap_.getView(),this.external_=!!t.target,this.set("zoomOffset",t.zoomOffset||1),this.set("active",!0),this.on("propertychange",this.setView_,this)},ol.inherits(ol.Overlay.Magnify,ol.Overlay),ol.Overlay.Magnify.prototype.setMap=function(t){this.getMap()&&($(this.getMap().getViewport()).off("mousemove",this.onMouseMove_),this.getMap().getView().un("propertychange",this.setView_,this)),ol.Overlay.prototype.setMap.call(this,t);$(t.getViewport()).on("mousemove",{self:this},this.onMouseMove_),t.getView().on("propertychange",this.setView_,this),this.setView_()},ol.Overlay.Magnify.prototype.getMagMap=function(){return this.mgmap_},ol.Overlay.Magnify.prototype.getActive=function(){return this.get("active")},ol.Overlay.Magnify.prototype.setActive=function(t){return this.set("active",t)},ol.Overlay.Magnify.prototype.onMouseMove_=function(t){var e=t.data.self;if(e.get("active")){var o=e.getMap().getEventCoordinate(t);e.external_||e.setPosition(o),e.mgview_.setCenter(o),"none"==$("canvas",e._elt).css("display")&&e.mgmap_.updateSize()}else e.setPosition()},ol.Overlay.Magnify.prototype.setView_=function(t){if(this.get("active")){if(!t)return this.setView_({key:"rotation"}),void this.setView_({key:"resolution"});switch(t.key){case"rotation":this.mgview_.setRotation(this.getMap().getView().getRotation());break;case"zoomOffset":case"resolution":var e=Math.max(0,this.getMap().getView().getZoom()+Number(this.get("zoomOffset")));this.mgview_.setZoom(e)}}else this.setPosition()},ol.Overlay.Popup=function(t){var e=this;this.offsetBox=t.offsetBox;var o=$(" ").addClass("ol-overlaycontainer-stopevent");t.element=o.get(0),$(" ").addClass("anchor").appendTo(o),this.content=$(" ").addClass("content").appendTo(o).get(0),this.closeBox=t.closeBox,this.onclose=t.onclose,this.onshow=t.onshow,$(" | |