1var GCPortalkarte;(()=>{"use strict";var t={5:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteBaseClass=void 0,e.GCPortalkarteBaseClass=class{constructor(){this.jquery=window.jQuery||null,this.ol=window.ol||null,this.proj4=window.proj4||null}registerProjection(t){return this.proj4&&this.ol&&(this.proj4.defs("EPSG:31466","+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs"),this.proj4.defs("EPSG:31467","+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs"),this.proj4.defs("EPSG:31468","+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs"),this.proj4.defs("EPSG:31469","+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs"),this.proj4.defs("EPSG:25832","+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),this.proj4.defs("EPSG:25833","+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),this.proj4.defs("EPSG:32632","+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +type=crs"),this.proj4.defs("EPSG:32633","+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +type=crs"),this.ol.proj.proj4.register(this.proj4)),this}getOL(){return this.ol}getJQuery(){return this.jquery}getProj4(){return this.proj4}}},57:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteGeocoderResponseClass=void 0,e.GCPortalkarteGeocoderResponseClass=class{constructor(t,e){this.portalmap=t,this.jquery=window.jQuery||null,this.ol=window.ol||null,this.proj4=window.proj4||null,this.map=t.getMap(),this.response=e}process(){this.response&&this.response.detailMode&&this.response.resultList&&this.processDetail(this.response.resultList[0])}processDetail(t){"landparcel"===t.featuretype?this.processFlurstueck(t):this.processPoint(t)}processFlurstueck(t){let e=this.portalmap.getLayerByName("responseLayer");e&&this.map.removeLayer(e);let i=new this.ol.style.Style({stroke:new this.ol.style.Stroke({color:"red",width:2}),fill:new this.ol.style.Fill({color:"rgba(255, 0, 0, 0.1)"})}),r=new this.ol.source.Vector({}),o=(new this.ol.format.WKT).readFeature(t.geometry.wkt,{dataProjection:t.geometry.crs,featureProjection:this.portalmap.getViewProjection()});o.setStyle(i),r.addFeature(o);let a=new this.ol.layer.Vector({source:r,idname:"responseLayer"});this.map.addLayer(a),this.map.getView().fit(o.getGeometry())}processPoint(t){let e=this.portalmap.getLayerByName("responseLayer");e&&this.map.removeLayer(e);let i=new this.ol.style.Circle({radius:10,stroke:new this.ol.style.Stroke({color:"red",width:2}),fill:new this.ol.style.Fill({color:"rgba(255, 0, 0, 0.2)"})}),r=new this.ol.style.Style({image:i}),o=new this.ol.source.Vector({}),a=(new this.ol.format.WKT).readFeature(t.geometry.wkt,{dataProjection:t.geometry.crs,featureProjection:this.portalmap.getViewProjection()});a.setStyle(r),o.addFeature(a);let n=new this.ol.layer.Vector({source:o,idname:"responseLayer"});this.map.addLayer(n),this.map.getView().fit(a.getGeometry())}}},67:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteStyle=void 0,e.GCPortalkarteStyle=class{constructor(){this.opacity=.6,this.fill_color="#f57878",this.stroke_color="#ff0000",this.stroke_width=3,this.radius=1,this.radius=this.stroke_width+5}getOpacity(){return this.opacity}setOpacity(t){return this.opacity=t,this}getFillColor(){return this.fill_color}setFillColor(t){return this.fill_color=t,this}getStrokeColor(){return this.stroke_color}setStrokeColor(t){return this.stroke_color=t,this}getStrokeWidth(){return this.stroke_width}setStrokeWidth(t){return this.stroke_width=t,this}getRadius(){return this.radius}setRadius(t){return this.radius=t,this}create(t){return t&&t.style?new t.style.Style({fill:new t.style.Fill({color:this.fill_color}),stroke:new t.style.Stroke({color:this.stroke_color,width:this.stroke_width}),image:new t.style.Circle({radius:this.radius,fill:new t.style.Fill({color:this.stroke_color})})}):null}}},457:(t,e)=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteDefaultValuesClass=void 0,e.GCPortalkarteDefaultValuesClass=class{constructor(){this.fillColor="blue",this.strokeColor="blue",this.strokeWidth=2,this.radius=5,this.anchor=[.5,1],this.opacity=1,this.padding=[20,20,20,20],this.maxZoom=14,this.maxZoomSteps=20,this.minZoomSteps=5,this.maxGeocoderZoom=0,this.duration=200,this.extentPaddingFactor=10,this.testValue=0,this.mapBackground="topplus",this.mapStartpoint=[11,51],this.mapStartzoom=10,this.mapWidth=400,this.mapHeight=400,this.mapDynamic=0,this.mapDefaultPointIconPath="/res/modules/portalkarte/icon/0313-location.svg",this.mapDefaultPointIconColor="#0080C0",this.mapDefaultPointIconOpacity=.8,this.mapDefaultPointIconAnchor=[.5,1],this.mapCtrlOptions={},this.mapViewProjection="EPSG:3857"}}},708:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteEditClass=void 0;const r=i(861),o=i(67),a=i(931);class n extends r.GCPortalkarteClass{constructor(t,e){super(t,e),this.ZoomToExtentCtrl=null,this.trackingLayer=null,this.geoJsonTarget="",this.is_editable=!0,this.is_edit_meta=!0,this.editbar=null,this.maxFeatures=0,this.trackinglayer_style=new o.GCPortalkarteStyle,this.callAs="edit"}initControlMap(t,e){void 0===t&&(t={}),void 0!==e&&e||(e=[]);let i=this.defaultValues;this.jquery.extend(i,t),this.setDebug(!1).setMaxZoom(i.maxZoom).setMaxZoomSteps(i.maxZoomSteps).setExtentPaddingFactor(i.extentPaddingFactor).addBasicBackgroundLayer(i.mapBackground).initFeatureLayer().initDirectFeatureLayer().initOverlayLayer().onFeatureClick(null);for(let t=0;t<e.length;t++)this.addFeature(e[t]);let r=this.jquery("#"+this.getTargetId());return i.mapDynamic?(r.prop("style","min-width:"+i.mapWidth+"px; height:"+i.mapHeight+"px"),r.addClass("w-100")):r.prop("style","width:"+i.mapWidth+"px; height:"+i.mapHeight+"px"),this.initMap(i.mapStartpoint),this}renderControlMap(t){return this.renderMap(t,!1),this.directFeatureLayer&&this.getMap().addLayer(this.directFeatureLayer),this.trackingLayer&&this.getMap().addLayer(this.trackingLayer),this}renderMap(t,e=!1,i=0){if(t<=0&&(t=this.defaultValues.maxZoom),i<=0&&(i=this.defaultValues.maxZoom),this.backgroundLayerExt){let t=new this.ol.layer.Group({title:"Hintergrundkarten",idname:"basis_map",allwaysOnTop:!1,noSwitcherDelete:!0,layers:this.backgroundLayerExt.reverse()});this.map.addLayer(t)}if(this.wmsLayerGroup&&this.wmsLayerGroup.length)for(let t of this.wmsLayerGroup.reverse())this.map.addLayer(t);let r=[];if(this.directFeatureLayer&&this.directFeatureCounter&&this.directFeatureLayer.get("pos")&&(this.map.addLayer(this.directFeatureLayer),r.push(this.directFeatureLayer.getSource().getExtent())),this.featureLayer&&this.featureCounter){if(this.additionalFeatureLayer)for(let t=this.additionalFeatureLayer.length;t>0;t--)this.map.addLayer(this.additionalFeatureLayer[t-1]),r.push(this.additionalFeatureLayer[t-1].getSource().getExtent());this.map.addLayer(this.featureLayer),r.push(this.featureLayer.getSource().getExtent())}this.directFeatureLayer&&this.directFeatureCounter&&!this.directFeatureLayer.get("pos")&&(this.map.addLayer(this.directFeatureLayer),r.push(this.directFeatureLayer.getSource().getExtent())),this.graticuleLayer&&this.map.addLayer(this.graticuleLayer),this.overlayLayer&&this.map.addOverlay(this.overlayLayer);for(let t=0;t<this.mapControls.length;t++)this.map.addControl(this.mapControls[t]);for(let t=0;t<this.mapInteractions.length;t++)this.map.addInteraction(this.mapInteractions[t]);let o=this.getExtent(r);this.debug("---- layerExtents"),this.debug(r),this.debug("---- currentExtent"),this.debug(o),o.length?this.map.getView().fit(o,{maxZoom:i,duration:this.defaultValues.duration}):(this.debug("startzoom= "+t),this.map.getView().setZoom(t)),this.defaultOnPointermove()}redrawExtent(){let t=this.getMap(),e=this.getTrackingLayer().getSource(),i=t.getView(),r=i.getResolutionForExtent(e.getExtent(),t.getSize()),o=r?parseInt(i.getZoomForResolution(r)):15,a=this.ol.extent.getCenter(e.getExtent());i.setCenter(a),i.setZoom(o)}getExtent(t){let e=null;this.trackingLayer&&(e=this.trackingLayer.getSource().getExtent(),"Infinity"==e[0]&&(e=null));let i=this.getMap().getControls();for(let t=0;t<i.getLength();t++)this.isEditable()&&i.item(t)instanceof this.ol.control.ZoomToExtent?this.ZoomToExtentCtrl=i.item(t):i.item(t)instanceof this.ol.control.ZoomToExtent&&this.getMap().removeControl(i.item(t));let r=[];if(this.ZoomToExtentCtrl&&e){let t=this.defaultValues.extentPaddingFactor,i=t*Math.abs(e[2]-e[0])/100,o=t*Math.abs(e[3]-e[1])/100;r[0]=e[0]-i,r[1]=e[1]-o,r[2]=e[2]+i,r[3]=e[3]+o,this.ZoomToExtentCtrl.extent=r}return this.setZoomToExtentState(),r}setZoomToExtentState(){if(this.ZoomToExtentCtrl){let t=this.ZoomToExtentCtrl.element,e=null,i=null;if(t){e=t.children;for(let t=0;t<e.length;t++)if("button"==e.item(t).tagName.toLowerCase()){i=e.item(t);break}}i&&(this.countFeatures()>0?i.disabled=!1:i.disabled=!0)}}initTrackingLayer(t){let e=this,i=new this.ol.source.Vector({});return t=t||"Eingabe-Layer",this.trackingLayer=new this.ol.layer.Vector({idname:"trackingLayer",title:t,info_type:"html",info_id:"featureTracking_info",show_info:0,opacity:e.getTrackinglayerStyle().getOpacity(),allwaysOnTop:!0,noSwitcherDelete:!0,updateWhileInteracting:!0,source:i,style:function(t){let i=t.get("type"),r=t.get("geometry_type"),o=null;return(i||r)&&(o=e.getPointStyle(i,r)),o||e.getTrackinglayerStyle().create(e.ol)}}),this}activateEditBar(t={}){this.editbar=new a.GCPortalkarteEditbarClass(this,this.getTrackingLayer()),this.editbar&&this.editbar.activateEditBar(t)}openEditDialog(){let t=this,e=t.jquery("#"+t.getTargetId()),i=t.getInfoUrl();i=i.replace("_INFO_ID_","").replace("_INFO_TYPE_","dialog"),i+="&show=editmeta";
1let r={title:"Bearbeiten",footer:!1,ajaxUrl:"",source_id:"feature_edit_meta",options:{append:e,description:{close:{caption:"SchlieÃen"}}}};BtpDialogClass.invokeDirect(r)}getTrackingLayer(){return this.trackingLayer}getCurrentLayer(){return this.trackingLayer}setGeoJsonTarget(t){return this.geoJsonTarget=t,this}setIsEditable(t){return this.is_editable=t,this}isEditable(){return this.is_editable}setIsEditMeta(t){return this.is_edit_meta=t,this}isEditMeta(){return this.is_edit_meta}getEditBar(){return this.editbar}static createFeatureMetadata(t,e,i,r){let o=prompt("Bitte einen Titel eingeben",i+" "+r);o||(o=i+" "+r),t.feature.set("idname","nf_"+r),t.feature.set("title",o)}saveData(t){void 0===t&&(t=this);let e=t.geoJsonTarget,i=t.trackingLayer.getSource(),r=(new t.ol.format.GeoJSON).writeFeatures(i.getFeatures());if(e){let t=document.getElementById(e.replace("#",""));t&&(t.value=r||"")}if(i){let e=i.getExtent();t.ZoomToExtentCtrl&&(t.ZoomToExtentCtrl.extent=e,t.setZoomToExtentState())}}getStatus(t="EPSG:4326"){let e=this.getMap().getView(),i=e.getCenter(),r=e.getProjection().getCode();return r!==t&&(i=this.ol.proj.transform(i,r,t),r=t),{zoom:e.getZoom(),center_x:Math.round(1e7*i[0])/1e7,center_y:Math.round(1e7*i[1])/1e7,crs:r}}countFeatures(){return this.trackingLayer.getSource().getFeatures().length}setMaxFeatures(t){return this.maxFeatures=t,this}getMaxFeatures(){return this.maxFeatures?Math.abs(this.maxFeatures):0}setTrackinglayerFeatureStyles(t,e,i,r,o){return this.getTrackinglayerStyle().setOpacity(t),this.getTrackinglayerStyle().setFillColor(e),this.getTrackinglayerStyle().setStrokeColor(i),this.getTrackinglayerStyle().setStrokeWidth(r),o?this.getTrackinglayerStyle().setRadius(o):this.getTrackinglayerStyle().setRadius(r+5),this}isAddFeaturePossible(){return!(this.getMaxFeatures()>0&&this.countFeatures()>=this.getMaxFeatures())}getTrackinglayerStyle(){return this.trackinglayer_style}setTrackinglayerStyle(t){return this.trackinglayer_style=t,this}}e.GCPortalkarteEditClass=n},861:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteClass=void 0;const r=i(5),o=i(457),a=i(57);class n extends r.GCPortalkarteBaseClass{constructor(t,e){super(),this.targetId="",this.idCounter=1,this.featureCounter=0,this.directFeatureCounter=0,this.pointStyles={},this.firstPoint=null,this.infoUrl="",this.getFeatureInfoActive=!1,this.url_path_extension="",this.debugOn=!1,this.GeolocationButtonInProgress=!1,this.restrictedExtent=null,this.callAs="map",this.targetId=t||"map",this.proj4Extent=null,this.defaultValues=new o.GCPortalkarteDefaultValuesClass,this.backgroundLayerExt=[],this.backgroundLayer=null,this.overviewLayer=null,this.featureLayer=null,this.additionalFeatureLayer=[],this.directFeatureLayer=null,this.wmsLayer=[],this.wmsLayerGroup=[],this.graticuleLayer=null,this.overlayLayer=null,this.url_path_extension="",this.mapControls=[],this.mapInteractions=[];let i={controls:this.mapControls,interactions:this.mapInteractions};this.jquery.extend(i,e),this.map=new this.ol.Map(i)}setDebug(t){return this.debugOn=t,this}getCurrentLayer(){return this.featureLayer}getAdditionalFeatureLayer(t){if(t=parseInt(t.toString()),this.additionalFeatureLayer.length>t&&t>=0)return this.additionalFeatureLayer[t]}getAdditionalFeatureLayerLength(){return this.additionalFeatureLayer.length}addAdditionalFeatureLayer(t){t&&this.additionalFeatureLayer.push(t)}isEditable(){return!1}getTargetId(){return this.targetId}setTargetId(t){return this.targetId=t,this}getMaxZoom(){return this.defaultValues.maxZoom}setMaxZoom(t){return this.defaultValues.maxZoom=t,this}getMaxZoomSteps(){return this.defaultValues.maxZoomSteps}setMaxZoomSteps(t){return this.defaultValues.maxZoomSteps=t,this}getMinZoomSteps(){return this.defaultValues.minZoomSteps}setMinZoomSteps(t){return this.defaultValues.minZoomSteps=t,this}getMaxGeocoderZoom(){return this.defaultValues.maxGeocoderZoom?this.defaultValues.maxGeocoderZoom:this.defaultValues.maxZoom}setMaxGeocoderZoom(t){return this.defaultValues.maxGeocoderZoom=t,this}getExtentPaddingFactor(){return this.defaultValues.extentPaddingFactor}setExtentPaddingFactor(t){return this.defaultValues.extentPaddingFactor=t,this}getDuration(){return this.defaultValues.duration}setDuration(t){return this.defaultValues.duration=t,this}getInfoUrl(){return this.infoUrl}setInfoUrl(t){return this.infoUrl=t,this}setGetFeatureInfoActive(t){return this.getFeatureInfoActive=t,this}isGetFeatureInfoActive(){return this.getFeatureInfoActive}getViewProjection(){return this.defaultValues.mapViewProjection}setViewProjection(t){return this.defaultValues.mapViewProjection=t,this.registerProjection(t),this}setRestrictedExtent(t){return this.restrictedExtent=t,this}getMap(){return this.map}getMapExtent(){return this.map.getView().calculateExtent(this.map.getSize())}getFeatureLayer(){return this.featureLayer}getDirectFeatureLayer(){return this.directFeatureLayer}setDirectFeatureLayer(t){this.directFeatureLayer=t}
1getBackgroundLayer(t){if(t){for(let e=0;e<this.backgroundLayerExt.length;e++)if(this.backgroundLayerExt[e].get("idname")===t)return this.backgroundLayerExt[e];return null}return this.backgroundLayer}getBackgroundLayers(){return this.backgroundLayerExt}getOverlayLayer(){return this.overlayLayer}getPointStyles(){return this.pointStyles}setPointStyles(t){return this.pointStyles=t,this}getPointStyle(t,e){if(this.pointStyles[t])return this.debug("KEY gefunden:"+t),this.pointStyles[t];switch(e=e.toLowerCase()){case"linestring":case"multiline":e="line";break;case"multipolygon":e="polygon"}return e&&this.pointStyles["__"+e]?(this.debug("GEOTYPE gefunden:"+e),this.pointStyles["__"+e]):this.pointStyles.default_point?(this.debug("DEFAULT_POINT gefunden"),this.pointStyles.default_point):null}addPointStyle(t,e){return this.pointStyles[t]=e,this}addPointstyleIcon(t,e,i,r,o){if(!t)return this;if(!e)return this;r=void 0!==r?parseFloat(r.toString()):this.defaultValues.opacity;let a={anchor:o=o&&Array.isArray(o)?o:this.defaultValues.anchor,anchorXUnits:"fraction",anchorYUnits:"fraction",src:e,scale:1,opacity:r};return i&&"#000000"!==i&&(a.color=i),this.debug("ICON-Style: "+t),this.debug(a),this.addPointStyle(t,new this.ol.style.Style({image:new this.ol.style.Icon(a)})),this}addPointstyleCircle(t,e,i,r,o,a){if(!t)return this;if(!e)return this;e=void 0!==e?parseInt(e.toString()):this.defaultValues.radius,i=i||"",o=void 0!==o?parseInt(o.toString()):this.defaultValues.strokeWidth,r=r||this.defaultValues.strokeColor,a=void 0!==a?parseFloat(a.toString()):this.defaultValues.opacity;let n={color:r,width:o},s=null;i&&(s=new this.ol.style.Fill({color:this.getRGBA(i,a)}));let l={radius:e,fill:s,stroke:new this.ol.style.Stroke(n),opacity:a};return this.debug("CIRCLE-Style: "+t),this.debug(l),this.addPointStyle(t,new this.ol.style.Style({image:new this.ol.style.Circle(l)})),this}addPointstylePolygon(t,e,i,r,o){if(!t)return this;e=e||"",r=void 0!==r?parseInt(r.toString()):this.defaultValues.strokeWidth,i=i||this.defaultValues.strokeColor,o=void 0!==o?parseFloat(o.toString()):this.defaultValues.opacity;let a={color:i,width:r},n=null;e&&(n=new this.ol.style.Fill({color:this.getRGBA(e,o)}));let s={fill:n,stroke:new this.ol.style.Stroke(a),opacity:o};return this.debug("POLYGON-Style: "+t),this.debug(s),this.addPointStyle(t,new this.ol.style.Style(s)),this}addPointstyleStroke(t,e,i,r){if(!t)return this;i=void 0!==i?parseInt(i.toString()):this.defaultValues.strokeWidth,e=e||this.defaultValues.strokeColor,r=void 0!==r?parseFloat(r.toString()):this.defaultValues.opacity;let o={color:e,width:i},a={stroke:new this.ol.style.Stroke(o),opacity:r};return this.debug("LINE-Style: "+t),this.debug(a),this.addPointStyle(t,new this.ol.style.Style(a)),this}setStyles(t){if(t.icon)for(let e in t.icon)if(t.icon.hasOwnProperty(e)){let i=t.icon[e].src?t.icon[e].src:"",r=t.icon[e].color?t.icon[e].color:null,o=t.icon[e].opacity?1*t.icon[e].opacity:this.defaultValues.opacity,a=t.icon[e].anchor?t.icon[e].anchor:this.defaultValues.anchor;this.addPointstyleIcon(e,i,r,o,a)}if(t.circle)for(let e in t.circle)if(t.circle.hasOwnProperty(e)){let i=t.circle[e].radius?1*t.circle[e].radius:10,r=t.circle[e].stroke?1*t.circle[e].stroke:2,o=t.circle[e].fillcolor?t.circle[e].fillcolor:"",a=t.circle[e].strokecolor?t.circle[e].strokecolor:"blue",n=t.circle[e].opacity?1*t.circle[e].opacity:1;this.addPointstyleCircle(e,i,o,a,r,n)}if(t.polygon)for(let e in t.polygon)if(t.polygon.hasOwnProperty(e)){let i=t.polygon[e].stroke?1*t.polygon[e].stroke:2,r=t.polygon[e].fillcolor?t.polygon[e].fillcolor:"",o=t.polygon[e].strokecolor?t.polygon[e].strokecolor:"blue",a=t.polygon[e].opacity?1*t.polygon[e].opacity:1;this.addPointstylePolygon(e,r,o,i,a)}if(t.line)for(let e in t.line)if(t.line.hasOwnProperty(e)){let i=t.line[e].stroke?1*t.line[e].stroke:2,r=t.line[e].strokecolor?t.line[e].strokecolor:"blue",o=t.line[e].opacity?1*t.line[e].opacity:1;this.addPointstyleStroke(e,r,i,o)}return this}addControls(t,e){let i=this,r={};switch(void 0===e&&(e={}),t){case"GeolocationButton":r.delay="3000",this.jquery.extend(r,e);let o=new this.ol.control[t](r),a=this.jquery(o.button_);a&&a.attr("title",r.tipLabel?r.tipLabel:"Zentriert Karte auf die Ihre Position.");let n=new this.ol.Overlay.Popup({positioning:"bottom-center"});this.getMap().addOverlay(n),o.on("position",(function(t){t.coordinate?(n.show(t.coordinate,"<div style='text-align: center'>Sie sind<br/>hier!</div>"),!i.GeolocationButtonInProgress&&i.isEditable()&&i.isAddFeaturePossible()&&(i.GeolocationButtonInProgress=!0,setTimeout((function(){confirm("Den ermittelten Punkt auf der Karte erzeugen?")&&i.addSimpleFeature
1(t.coordinate,null,"Standort")}),2e3))):(n.hide(),i.GeolocationButtonInProgress=!1)})),this.mapControls[this.mapControls.length]=o;break;case"Attribution":case"Scale":case"ScaleLine":case"ZoomSlider":this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"FullScreen":r.tipLabel="Wechselt zwischen voller Seite-Ansicht hin und her",this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"MousePosition":r.projection="EPSG:4326",r.coordinateFormat=function(t){return i.ol.coordinate.format(t,"{y}, {x}",8)},this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"OverviewMap":this.overviewLayer&&(r.className="ol-overviewmap ol-custom-overviewmap",r.layers=[this.overviewLayer],r.tipLabel="Blendet verkleinerte Ãbersichtskarte ein",r.rotateWithView=!0,this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r));break;case"Rotate":r.tipLabel="Orientiert die Karte wieder nach Norden",this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"ZoomToExtent":r.label="Z",r.tipLabel="Zoom auf alle aktuellen Punkte",this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"Zoom":r.duration=500,r.zoomInTipLabel="Zoom in die Karte hinein",r.zoomOutTipLabel="Zoom aus der Karte heraus",this.jquery.extend(r,e),this.mapControls[this.mapControls.length]=new this.ol.control[t](r);break;case"LayerSwitcher":r.show_progress=!0,r.trash=!0,r.reordering=!0,this.jquery.extend(r,e),r.targetname&&(r.target=this.jquery(r.targetname).get(0));let s=!1;r.info&&(s=!0),this.ol.control.LayerSwitcher.prototype.tip={up:"Hoch/Runter",down:"Runter",info:"Informationen...",extent:"Zoom auf Extent",trash:"Layer entfernen",plus:"Auf-/Zuklappen"},this.jquery.extend(r,e);let l=new this.ol.control[t](r),u=this.jquery(l.button);u&&u.attr("title",r.tipLabel?r.tipLabel:"Ebenenverwaltung..."),s&&l.on("drawlist",(function(t){let e=t.layer;e&&e.get("show_info")&&("cat"==e.get("info_type")||"html"==e.get("info_type"))&&i.jquery('<div title="Information">').addClass("layerInfo").click((function(){i.openDialog(e.get("info_id"),e.get("info_type"),"","",e)})).appendTo(i.jquery("> .ol-layerswitcher-buttons",t.li))})),l.on("drawlist",(function(t){let e=t.layer;e&&e.get("show_legend")&&"cat"==e.get("info_type")&&i.jquery('<div title="Legende">').addClass("layerLegend").click((function(){i.openDialog(e.get("info_id"),e.get("info_type"),"Legende","show=legend")})).appendTo(i.jquery("> .ol-layerswitcher-buttons",t.li))})),this.mapControls[this.mapControls.length]=l;break;case"LegendDialog":let d=new this.ol.control.Button({html:'<i class="icon icon-list"></i>',className:"ol-legenddialog",title:"Legende für alle sichtbaren Layer",handleClick:function(t){let e=[];
1if(i.getMap().getLayers().forEach((function(t,i){let r=t.get("layers");r&&r.forEach((function(t,i){t.getVisible()&&"cat"===t.get("info_type")&&e.push(t.get("info_id"))}))})),e){let t=i.jquery("#"+i.getTargetId()),r=i.getInfoUrl();r=r.replace("_INFO_ID_",e.toString()).replace("_INFO_TYPE_","cat"),r+="&show=legend";let o={title:"Legenden",footer:!0,ajaxUrl:"",options:{append:t,description:{close:{caption:"SchlieÃen"}}}};BtpDialogClass.invokeDirect(o,r)}}});this.mapControls[this.mapControls.length]=d;break;case"SearchNominatim":r.label="Gehe zu",r.placeholder="Gehe zu ...",r.className="ol-search-nominatim",r.polygon=!1,r.reverse=!1,r.position=!0,this.jquery.extend(r,e);let h=new this.ol.control[t](r);h.on("select",(function(t){let e=i.getMap();if(t.search.geojson){let r=(new i.ol.format.GeoJSON).readFeature(t.search.geojson,{dataProjection:"EPSG:4326",featureProjection:e.getView().getProjection()}),o=e.getView(),a=o.getResolutionForExtent(r.getGeometry().getExtent(),e.getSize()),n=o.getZoomForResolution(a),s=i.ol.extent.getCenter(r.getGeometry().getExtent());setTimeout((function(){o.animate({center:s,zoom:Math.min(n,i.getMaxGeocoderZoom())})}),100)}else e.getView().animate({center:t.coordinate,zoom:Math.max(e.getView().getZoom(),i.getMaxGeocoderZoom())}),i.isEditable()&&i.isAddFeaturePossible()&&setTimeout((function(){if(confirm("Koordinaten-Objekt auf der Karte erzeugen?")){let e=t.search.display_name?t.search.display_name:"Neuer Punkt";e=e.substring(0,99),i.addSimpleFeature(t.coordinate,null,e)}}),2e3)})),this.mapControls[this.mapControls.length]=h}return this}addInteractions(t,e){let i={},r=this;switch(void 0===e&&(e={}),t){case"Select":if(this.jquery.extend(i,e),void 0!==i.popup&&i.popup){let e=new this.ol.Overlay.Popup({popupClass:"default",closeBox:!0,onshow:function(){console.log("You opened the box")},onclose:function(){console.log("You close the box")},positioning:"auto",autoPan:!0,autoPanAnimation:{duration:250}}),r=new this.ol.interaction[t](i);r.getFeatures().on(["add"],(function(t){let i=t.element,r="";r+=i.get("title"),e.show(i.getGeometry().getFirstCoordinate(),r)})),r.getFeatures().on(["remove"],(function(t){e.hide()}))}break;case"DragBox":this.jquery.extend(i,e);let o=new this.ol.interaction[t](i);o.on("boxend",(function(){let t=o.getGeometry().getExtent();r.map.getView().fit(t,{maxZoom:r.defaultValues.maxZoom,duration:r.defaultValues.duration})})),this.mapInteractions[this.mapInteractions.length]=o;break;case"DragPan":this.jquery.extend(i,e),i.condition=function(t){let e="ontouchstart"in window||navigator.msMaxTouchPoints>0;return!e&&1===this.getPointerCount()||e&&2===this.getPointerCount()||r.ol.events.condition.platformModifierKeyOnly(t)};let a=new this.ol.interaction[t](i);this.mapInteractions[this.mapInteractions.length]=a;break;default:this.jquery.extend(i,e),this.mapInteractions[this.mapInteractions.length]=new this.ol.interaction[t](i)}return this}setControlsAndInteractions(t){if(t.graticule&&this.initGraticuleLayer(),t.controls)for(let e in t.controls)t.controls.hasOwnProperty(e)&&this.addControls(e,t.controls[e]);if(t.interactions)for(let e in t.interactions)t.interactions.hasOwnProperty(e)&&this.addInteractions(e,t.interactions[e]);return this}addBackgroundLayerList(t){let e=null;for(let i of t)switch(i.type){case"basic":this.addBasicBackgroundLayer(i.name);break;case"wmts":this.addWMTSBackgroundLayer(i.title,i.name,i.url,i.params,i.attributions?i.attributions:"",0,{});break;case"wms":e={title:i.title,info_id:void 0!==i.info_id?i.info_id:null,info_type:void 0!==i.info_type?i.info_type:null,show_info:void 0!==i.show_info?i.show_info:null,show_legend:void 0!==i.show_legend?i.show_legend:null,source:new this.ol.source.TileWMS({url:i.url,params:{LAYERS:i.name,STYLES:i.style,FORMAT:"image/png"},serverType:"geoserver",attributions:i.attributions})},this.__addBackgroundLayer(i.name,e)}}__addBackgroundLayer(t,e){e&&(e.baseLayer=!0,e.visible=!1,e.idname="backgroundLayer_"+t,this.restrictedExtent&&(e.extent=this.restrictedExtent),this.backgroundLayer?this.backgroundLayerExt.push(new this.ol.layer.Tile(e)):(e.allwaysOnTop=!0,e.noSwitcherDelete=!0,e.visible=!0,this.backgroundLayer=new this.ol.layer.Tile(e),this.overviewLayer=new this.ol.layer.Tile(e),this.backgroundLayerExt.push(this.backgroundLayer)))}
1addBasicBackgroundLayer(t){new Date;let e=null;switch(t){case"basemap":case"webatlas":e=this.getBackgroundOption_BaseMapDe(t,"de_basemapde_web_raster_farbe","BASEMAP.DE");break;case"basemap_grau":case"webatlas_grau":e=this.getBackgroundOption_BaseMapDe(t,"de_basemapde_web_raster_grau","BASEMAP.DE GRAU");break;case"topplus":e=this.getBackgroundOption_TopPlus(t,"web","TopPlus");break;case"topplus_grau":e=this.getBackgroundOption_TopPlus(t,"web_grau","TopPlus GRAU");break;case"osm":e={title:"OSM",source:new this.ol.source.OSM({url:"https://tile.openstreetmap.de/{z}/{x}/{y}.png"})}}return this.__addBackgroundLayer(t,e),this}addWMTSBackgroundLayer(t,e,i,r,o,a,n){void 0===n&&(n={});let s={title:(t||e)+" (WMTS)",info_id:1,info_type:"html",show_info:1};this.jquery.extend(s,n),this.debug(s);let l=(r.layer?r.layer:e)+"_"+(r.matrixSet?r.matrixSet:"")+"_"+(r.id_extention?r.id_extention:"");this.__addBackgroundLayer(l,s);let u=this,d=this.getViewProjection();return fetch(i).then((function(t){return t.text()})).then((function(t){let a=(new u.ol.format.WMTSCapabilities).read(t),n={layer:r.layer?r.layer:e,matrixSet:r.matrixSet,projection:r.projection||d},s=u.ol.source.WMTS.optionsFromCapabilities(a,n);if(s){s.crossOrigin="",s.projection=r.projection||d,s.wrapX=!1,s.attributions=o||(a.ServiceIdentification.Fees?a.ServiceIdentification.Fees:a.ServiceProvider.ProviderName);let t=u.getBackgroundLayer("backgroundLayer_"+l);t&&(u.debug(a.ServiceIdentification),t.get("title")||t.set("title",a.ServiceIdentification.Title),t.set("abstract",a.ServiceIdentification.Abstract),t.setSource(new u.ol.source.WMTS(s)))}else console.error("Options nach Aufruf von ["+i+"] ist null!")})),null}createAdditionalFeatureLayer(t){let e=this;return t=t||"Feature-Layer "+(this.additionalFeatureLayer.length+1),new this.ol.layer.Vector({idname:"addfeatureLayer"+(this.additionalFeatureLayer.length+1),title:t,info_type:"html",info_id:"featureLayer_info",show_info:1,allwaysOnTop:!0,noSwitcherDelete:!0,source:new this.ol.source.Vector({}),style:function(t){var i;let r=t.get("type"),o=null!==(i=t.get("geometry_type"))&&void 0!==i?i:t.getGeometry().getType(),a=null;return(r||o)&&(a=e.getPointStyle(r,o)),a||new e.ol.style.Style({fill:new e.ol.style.Fill({color:"#33ffc5"}),stroke:new e.ol.style.Stroke({color:"#3377ff",width:2}),image:new e.ol.style.Circle({radius:7,fill:new e.ol.style.Fill({color:"#ff3374"})})})}})}initVectorLayerForFeature(t){let e=this;return new this.ol.layer.Vector({idname:t.idname,title:t.title,info_type:"html",info_id:t.idname+"_info",show_info:1,allwaysOnTop:!0,noSwitcherDelete:!0,source:new this.ol.source.Vector({}),style:function(i){var r;let o=i.get("type"),a=null!==(r=i.get("geometry_type"))&&void 0!==r?r:i.getGeometry().getType(),n=null;return(o||a)&&(n=e.getPointStyle(o,a)),n||new e.ol.style.Style({fill:new e.ol.style.Fill({color:t.fill_color}),stroke:new e.ol.style.Stroke({color:t.stroke_color,width:2}),image:new e.ol.style.Circle({radius:7,fill:new e.ol.style.Fill({color:t.circle_color})}),opacity:.5})}})}initFeatureLayer(t){let e={idname:"featureLayer",title:t||"Feature-Layer",fill_color:"#33ffc5",stroke_color:"#3377ff",circle_color:"#ff3374"};return this.featureLayer=this.initVectorLayerForFeature(e),this}initDirectFeatureLayer(t){let e={idname:"directFeatureLayer",title:t||"DirectFeature-Layer",fill_color:this.getRGBA("#ffcc33",.3),stroke_color:this.getRGBA("#ffcc33",.5),circle_color:this.getRGBA("#ffcc33",.5)};return this.directFeatureLayer=this.initVectorLayerForFeature(e),this}initGraticuleLayer(){return this.graticuleLayer=new this.ol.layer.Graticule({idname:"graticuleLayer",title:"Gradgitter",displayInLayerSwitcher:!1,strokeStyle:new this.ol.style.Stroke({color:"rgba(255,120,0,0.9)",width:2,lineDash:[.5,4]}),showLabels:!0,wrapX:!1}),this}initOverlayLayer(){return this.jquery("body").append('<div class="arrow_box" id="'+this.getTargetId()+'-popup-container"><div id="'+this.getTargetId()+'-popup-content" class="text-dark"></div></div>'),this.overlayLayer=new this.ol.Overlay({idname:"infoLayer",id:"info_overlay",element:document.getElementById(this.getTargetId()+"-popup-container"),positioning:"bottom-center",offset:[0,-20],stopEvent:!0,autoPan:!0}),this}addWMS(t,e,i,r,o,a,n){void 0===n&&(n={}),this.wmsLayer=[];for(let t of r)void 0===t.options&&(t.options={}),this.addWMSLayer(t.title,t.name,t.url,t.no_tiled,t.params,t.attributions,t.is_visible,{info_id:void 0!==t.options.info_
1id?t.options.info_id:null,info_type:void 0!==t.options.info_type?t.options.info_type:null,show_info:void 0!==t.options.show_info?t.options.show_info:0,show_legend:void 0!==t.options.show_legend?t.options.show_legend:0,getfeatureinfo:void 0!==t.options.getfeatureinfo?t.options.getfeatureinfo:0,description:t.description,bbox:void 0!==t.bbox?t.bbox:null});let s={title:t,idname:e,description:i,visible:!!a,layers:this.wmsLayer.reverse()};this.jquery.extend(s,n),this.debug(s);let l=new this.ol.layer.Group(s);return this.wmsLayerGroup.push(l),this}addWMSLayer(t,e,i,r,o,a,n,s){var l,u;void 0===s&&(s={});let d=null!==(l=s.bbox)&&void 0!==l?l:null,h=null;if(d&&d.minx){let t=[d.minx,d.miny],e=[d.maxy,d.maxy];const i=null!==(u=d.crs)&&void 0!==u?u:"EPSG:4326",r=this.getViewProjection();t=this.ol.proj.transform(t,i,r),e=this.ol.proj.transform(e,i,r),h=[t[0],t[1],e[0],e[1]]}if(r){let r=new this.ol.source.ImageWMS({url:i,params:o,attributions:a,serverType:"geoserver",ratio:1.5,projection:this.getViewProjection()}),l={title:t||e,visible:!!n,source:r,idname:e};h&&(l={title:t||e,visible:!!n,extent:h,source:r,idname:e}),this.jquery.extend(l,s),this.debug(l);let u=new this.ol.layer.Image(l);return this.debug(u),this.wmsLayer.push(u),this}{let r=new this.ol.source.TileWMS({url:i,params:o,attributions:a,serverType:"geoserver",projection:o.CRS?o.CRS:this.getViewProjection()}),l={title:t||e,visible:!!n,source:r,idname:e};h&&(l={title:t||e,visible:!!n,extent:h,source:r,idname:e}),this.jquery.extend(l,s),this.debug(l);let u=new this.ol.layer.Tile(l);return this.debug(u),this.wmsLayer.push(u),this}}getWMSLayer(t){let e={};for(let i of this.wmsLayer)i.get("idname")==t&&(e=i);return e}addFeature(t,e=!1,i=null){let r=void 0!==t.id&&t.id?t.id:this.idCounter++,o=void 0!==t.unique_id&&t.unique_id?t.unique_id:r;o="UID_"+o;let a=void 0!==t.title&&t.title?t.title:"Punkt "+r,n=void 0!==t.desc&&t.desc?t.desc:"",s=void 0!==t.url&&t.url?t.url:null,l=void 0!==t.url_target&&t.url_target?t.url_target:null,u=void 0!==t.info_url&&t.info_url?t.info_url:null,d=void 0!==t.coords&&t.coords?t.coords:null,h=(void 0!==t.poly&&t.poly&&t.poly,void 0!==t.wkt&&t.wkt?t.wkt:null),c=void 0!==t.crs&&t.crs?t.crs:this.defaultValues.mapViewProjection,g=void 0!==t.type&&t.type?t.type:"standard",p=void 0!==t.style&&t.style?t.style:{},y=void 0!==t.geometry_type&&t.geometry_type?t.geometry_type:"point",m=void 0!==t.icon&&t.icon?t.icon:"";d&&c!=this.defaultValues.mapViewProjection&&(this.debug("Punkt: Vor Transformation: "+d),d=this.ol.proj.transform(d,c,this.defaultValues.mapViewProjection),this.debug("Punkt: Nach Transformation: "+d));let f=new this.ol.geom.Point(d);if(("multipolygon"==y||"polygon"==y||"line"==y||"multiline"==y)&&h){let t=c;if(f=null,h&&t){const e=new this.ol.format.WKT;try{f=e.readFeature(h,{dataProjection:t,featureProjection:this.getViewProjection()}).getGeometry()}catch(t){console.error("WKT konnte nicht korrekt gelesen werden."),console.error(h)}}m=""}if("multipolygon"!=y&&"polygon"!=y||!p.unique_id||(this.addPointstylePolygon(p.unique_id,p.fillColor,p.strokeColor,p.strokeWidth,p.opacity?parseFloat(p.opacity):1),g=p.unique_id),"multiline"!=y&&"line"!=y||!p.unique_id||(this.addPointstyleStroke(p.unique_id,p.strokeColor,p.strokeWidth,1),g=p.unique_id),"point"==y&&p.unique_id&&(this.addPointstyleCircle(p.unique_id,7,p.fillColor,p.strokeColor,p.strokeWidth,p.opacity?parseFloat(p.opacity):1),g=p.unique_id),m&&(this.addPointstyleIcon(m,m,null,1,[.5,1]),g=m),this.debug(t),!d||!f)return this;let w=new this.ol.Feature({geometry:f,labelPoint:new this.ol.geom.Point(d),crs:c,name:a,description:n,type:g,geometry_type:y,url:s||null,url_target:l||null,info_url:u||null,unique_id:o,coord_id:r});return w.setId(r),i?(i.getSource().addFeature(w),this.featureCounter++):e?this.directFeatureLayer&&this.directFeatureLayer.getSource()&&(this.directFeatureLayer.getSource().addFeature(w),"edit"!==this.callAs&&(this.directFeatureCounter||(this.firstPoint=d),this.directFeatureCounter++)):(this.featureLayer.getSource().addFeature(w),this.featureCounter||(this.firstPoint=d),this.featureCounter++),this}
1addSimpleFeature(t,e,i){let r=this.idCounter++,o=r.toString();o="UID_"+o;let a=void 0!==i&&i?i:"Punkt "+r,n=void 0!==t&&t?t:null,s=void 0!==e&&e?e:this.defaultValues.mapViewProjection;if(n&&(this.debug("Vor Transformation: "+n),n=this.ol.proj.transform(n,s,this.defaultValues.mapViewProjection),this.debug("Nach Transformation: "+n)),!n)return this;let l=new this.ol.geom.Point(n),u=new this.ol.Feature({geometry:l,labelPoint:new this.ol.geom.Point(n),crs:s,name:a,title:a,type:"default_point",geometry_type:"point",url:null,url_target:null,unique_id:o,coord_id:r});return this.getCurrentLayer().getSource().addFeature(u),this.featureCounter||(this.firstPoint=l.getCoordinates()),this.featureCounter++,this}openDialog(t,e,i,r,o){let a=window.jQuery("#"+this.getTargetId());if("html"==e&&o){let t=o.get("abstract");if(!t){let e=o.get("json");e&&(t=e.abstract)}let e={title:i||"Informationen",footer:!0,options:{append:a,description:{close:{caption:"SchlieÃen"}}}};return BtpDialogClass.invokeDirect(e,"",!0).setContent(t),!1}if(void 0!==t&&void 0!==e&&"html"==e){let e=this.jquery("#"+t);if(e){let t={title:i||"Informationen",footer:!0,options:{append:a,description:{close:{caption:"SchlieÃen"}}}};BtpDialogClass.invokeDirect(t,"",!0).setContent(e.html())}return!1}{let o=this.getInfoUrl();if(void 0!==t&&o){o=o.replace("_INFO_ID_",t.toString()).replace("_INFO_TYPE_",e),r&&(o=o+"&"+r);let n={title:i||"Informationen",footer:!0,ajaxUrl:"",options:{append:a,description:{close:{caption:"SchlieÃen"}}}};return BtpDialogClass.invokeDirect(n,o),!1}}return alert("Keine Infos"),!1}initMap(t){this.map.setTarget(this.getTargetId()),this.debug(this.defaultValues.maxZoom);let e={center:this.ol.proj.fromLonLat(t,this.defaultValues.mapViewProjection),zoom:this.defaultValues.maxZoom,minZoom:this.defaultValues.minZoomSteps,maxZoom:this.defaultValues.maxZoomSteps,projection:this.defaultValues.mapViewProjection};this.debug(e);let i=new this.ol.View(e);return this.proj4Extent&&i.getProjection().setExtent(this.proj4Extent),this.map.setView(i),this}renderMap(t,e=!1,i=0){if(t<=0&&(t=this.defaultValues.maxZoom),i<=0&&(i=this.defaultValues.maxZoom),this.backgroundLayerExt){let t=new this.ol.layer.Group({title:"Hintergrundkarten",idname:"basis_map",allwaysOnTop:!1,noSwitcherDelete:!0,layers:this.backgroundLayerExt.reverse()});this.map.addLayer(t)}if(this.wmsLayerGroup&&this.wmsLayerGroup.length)for(let t of this.wmsLayerGroup.reverse())this.map.addLayer(t);let r=[];if(this.directFeatureLayer&&this.directFeatureCounter&&this.directFeatureLayer.get("pos")&&(this.map.addLayer(this.directFeatureLayer),r.push(this.directFeatureLayer.getSource().getExtent()),this.debug("---- layerExtents directFeatureLayer"),this.debug(r)),this.featureLayer&&this.featureCounter){if(this.additionalFeatureLayer)for(let t=this.additionalFeatureLayer.length;t>0;t--)this.map.addLayer(this.additionalFeatureLayer[t-1]),r.push(this.additionalFeatureLayer[t-1].getSource().getExtent());this.map.addLayer(this.featureLayer),r.push(this.featureLayer.getSource().getExtent()),this.debug("---- layerExtents featureLayer"),this.debug(r)}this.directFeatureLayer&&this.directFeatureCounter&&!this.directFeatureLayer.get("pos")&&(this.map.addLayer(this.directFeatureLayer),r.push(this.directFeatureLayer.getSource().getExtent()),this.debug("---- layerExtents directFeatureLayer"),this.debug(r)),this.graticuleLayer&&this.map.addLayer(this.graticuleLayer),this.overlayLayer&&this.map.addOverlay(this.overlayLayer);for(let t=0;t<this.mapControls.length;t++)this.map.addControl(this.mapControls[t]);for(let t=0;t<this.mapInteractions.length;t++)this.map.addInteraction(this.mapInteractions[t]);let o=this.getExtent(r);this.debug("---- layerExtents"),this.debug(r),this.debug("---- currentExtent"),this.debug(o),this.debug("---- fit_zoom"),this.debug(i),o&&o.length?this.map.getView().fit(o,{maxZoom:i,duration:this.defaultValues.duration}):(this.debug("startzoom= "+t),this.map.getView().setZoom(t)),this.defaultOnPointermove()}getExtent(t){let e=null;if(!t.length)return null;e=t[0];for(let i=1;i<t.length;i++)e=this.ol.extent.extend(e,t[i]);if(!e)return null;let i=[],r=this.defaultValues.extentPaddingFactor,o=r*Math.abs(e[2]-e[0])/100,a=r*Math.abs(e[3]-e[1])/100;this.debug("padding= "+r),this.debug("paddingx= "+o),this.debug("paddingy= "+a),i[0]=e[0]-o,i[1]=e[1]-a,i[2]=e[2]+o,i[3]=e[3]+a;let n=this.map.getControls();for(let t=0;t<n.getLength();t++)this.featureCounter>0&&n.item(t)instanceof this.ol.control.ZoomToExtent?n.item(t).extent=i:0==this.featureCounter&&n.item(t)instanceof this.ol.control.ZoomToExtent&&this.map.removeControl(n.item(t));return i}onFeatureClick(t){return t?this.map.on("click",t):null===t&&this.map.on("click",this.defaultOnClick),this}defaultOnPointermove(){if(this.getMap().isGetFeatureInfoActive=0,this.isGetFeatureInfoActive()){this.getMap().isGetFeatureInfoActive=1;let t=this;this.getMap().on("pointermove",(function(e){if(e.dragging)return;let i=t.getMap().getEventPixel(e.originalEvent),r=t.getMap().forEac
1hLayerAtPixel(i,(function(t){return t.get("getfeatureinfo")}));t.getMap().getTargetElement().style.cursor=r?"pointer":""}))}else this.getMap().on("pointermove",(function(t){t.dragging||n.defaultShowFeature(t,!1,n.only_first_feature)}))}static defaultGetFeatureInfo(t){let e=t.map,i=e.get("target"),r=window.jQuery("#"+i),o=window.jQuery("#"+i+"_modal"),a=window.jQuery("#"+i+"_modal_dialog"),n=window.jQuery("#"+i+"_info"),s=0;e.modalStatus?e.modalStatus=0:(e.modalStatus=1,e.forEachLayerAtPixel(t.pixel,(function(i){let l=i.getProperties();if(void 0!==l.source.getFeatureInfoUrl){let i=e.getView().getResolution(),u=l.source.getFeatureInfoUrl(t.coordinate,i,e.getView().getProjection(),{INFO_FORMAT:"text/html",FEATURE_COUNT:100});u&&fetch("ws/cors-proxy/?source="+encodeURIComponent(u)).then((function(t){return t.text()})).then((function(t){if(t){let i=null;s?i=window.jQuery('<div class="mt-2 border-top"><div class="small text-muted d-none">'+l.title+"</div>"+t+"</div>"):(s=1,o.modal("dispose"),n.empty(),o.on("hidden.bs.modal",(function(t){e.modalStatus=0})),o.appendTo(r),o.modal("show"),a.draggable({handle:".modal-header"}),i=window.jQuery('<div class=""><div class="small text-muted d-none">'+l.title+"</div>"+t+"</div>")),i.appendTo(n)}}))}}),{hitTolerance:1,layerFilter:function(t){return t.get("getfeatureinfo")}}))}static defaultShowFeature(t,e=!1,i=1){let r={},o='<ul class="list-group list-group-flush p-2 m-0">',a=0,n=t.map.forEachFeatureAtPixel(t.pixel,(function(t){var e;let o=t.getProperties(),a="",n="";if(void 0!==o.name||void 0!==o.title){if(n=null!==(e=o.name)&&void 0!==e?e:o.title,a=o.description,o.url){let t=o.url;if(-1!==t.indexOf("JS###")){let e=t.split("###");t=e[1],r[o.unique_id]=`<li class="list-group-item list-group-item-action p-1"><a onclick="${t}; return false" href="#" target="${o.url_target}">${o.name}</a></li>`}else r[o.unique_id]=`<li class="list-group-item list-group-item-action p-1"><a href="${t}" target="${o.url_target}">${n}</a></li>`}else r[o.unique_id]=a?`<li class="list-group-item list-group-item-action p-1"><strong>${n}</strong><div class="small p-0 m-0" style="max-width: 200px !important">${a}</div></li>`:`<li class="list-group-item list-group-item-action p-1"><strong>${n}</strong></li>`;return i?1:0}return 0}),{hitTolerance:1});for(var s in r)o+=r[s],a++;o+="</ul>";let l=t.map.getOverlayById("info_overlay"),u=e?1:!l.get("onclick");if(l&&u){let i=t.map.getProperties().target+"-popup-content";a?(document.getElementById(i).innerHTML=o,l.setPosition(t.coordinate),e&&l.set("onclick",1)):(l.setPosition(),e&&l.set("onclick",0))}t.map.getTargetElement().style.cursor=n?"pointer":""}defaultOnClick(t){t.map.isGetFeatureInfoActive&&n.defaultGetFeatureInfo(t),n.defaultShowFeature(t,!0,n.only_first_feature)}debug(t){this.debugOn&&console.log(t)}createSimpleMap(t,e){void 0===t&&(t={});let i=this.defaultValues;this.jquery.extend(i,t),this.addPointstyleIcon("default_point",this.getUrl(i.mapDefaultPointIconPath),i.mapDefaultPointIconColor,i.mapDefaultPointIconOpacity,i.mapDefaultPointIconAnchor),this.addPointstyleCircle("default_circle",i.radius,i.fillColor,i.strokeColor,i.strokeWidth,i.opacity),this.addPointstylePolygon("default_polygon",i.fillColor,i.strokeColor,i.strokeWidth,i.opacity),this.addPointstyleStroke("default_line",i.strokeColor,i.strokeWidth,i.opacity),this.setMaxZoom(i.maxZoom).setMaxZoomSteps(i.maxZoomSteps).setExtentPaddingFactor(i.extentPaddingFactor).addBasicBackgroundLayer(i.mapBackground).initFeatureLayer().initDirectFeatureLayer().initOverlayLayer().onFeatureClick(null).setControlsAndInteractions(i.mapCtrlOptions).addInteractions("DoubleClickZoom",[]).addInteractions("DragPan",[]);for(let t=0;t<e.length;t++)this.addFeature(e[t]);let r=this.jquery("#"+this.getTargetId());return i.mapDynamic?(r.prop("style","min-width:"+i.mapWidth+"px; height:"+i.mapHeight+"px"),r.addClass("w-100")):r.prop("style","width:"+i.mapWidth+"px; height:"+i.mapHeight+"px"),this.initMap(i.mapStartpoint),this.renderMap(i.mapStartzoom),this}getLayerByName(t){let e=this.map.getLayers().getArray(),i={};for(let r of e)r.get("idname")==t&&(i=r);return i}onGeocoderResponse(t){t&&new a.GCPortalkarteGeocoderResponseClass(this,t).process()}
1getBackgroundOption_TopPlus(t,e,i){let r=this,o=new Date,a={},n=!1,s="",l=this.getViewProjection();switch(l){case"EPSG:25832":n=!0,s="EU_EPSG_25832_TOPPLUS";break;case"EPSG:3857":case"EPSG:900913":n=!0,s="WEBMERCATOR"}if(n){let n=new this.ol.format.WMTSCapabilities;fetch("https://sg.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml").then((function(t){return t.text()})).then((function(i){let a=n.read(i),u=r.ol.source.WMTS.optionsFromCapabilities(a,{layer:e,matrixSet:s});u.crossOrigin="",u.projection=l,u.wrapX=!1;let d="Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie "+o.getFullYear()+", ";u.attributions=d+'Datenquellen: <a href="https://sgx.geodatenzentrum.de/web_public/gdz/datenquellen/Datenquellen_TopPlusOpen.html" target="_blank">https://sgx.geodatenzentrum.de/web_public/gdz/datenquellen/Datenquellen_TopPlusOpen.html</a>';let h=r.getBackgroundLayer("backgroundLayer_"+t);h&&h.setSource(new r.ol.source.WMTS(u))})),a={title:i+" (WMTS)"}}else a={title:i,source:new this.ol.source.TileWMS({url:"https://sgx.geodatenzentrum.de/wms_topplus_open",params:{LAYERS:e,STYLES:"default",FORMAT:"image/png"},attributions:'<a href="http://www.bkg.bund.de" target="">Bundesamt für Kartographie und Geodäsie</a> '+o.getFullYear()+', <a href="http://sg.geodatenzentrum.de/web_public/Datenquellen_TopPlus_Open.pdf" target="_blank">Datenquellen</a>'})};return a}getBackgroundOption_BaseMapDe(t,e,i){let r=this,o=new Date,a={},n=!1,s="",l=this.getViewProjection();switch(l){case"EPSG:25832":n=!0,s="DE_EPSG_25832_ADV";break;case"EPSG:25833":n=!0,s="DE_EPSG_25833_ADV";break;case"EPSG:3857":n=!0,s="DE_EPSG_3857_ADV";break;case"EPSG:900913":n=!0,s="GLOBAL_WEBMERCATOR"}if(n){let n=new this.ol.format.WMTSCapabilities;fetch("https://sgx.geodatenzentrum.de/wmts_basemapde/1.0.0/WMTSCapabilities.xml").then((function(t){return t.text()})).then((function(i){let a=n.read(i),u=r.ol.source.WMTS.optionsFromCapabilities(a,{layer:e,matrixSet:s});u.crossOrigin="",u.projection=l,u.wrapX=!1;let d="Kartendarstellung und Präsentationsgraphiken: © Bundesamt für Kartographie und Geodäsie "+o.getFullYear()+", ";u.attributions=d+'Datenquellen: <a href="https://gdz.bkg.bund.de/index.php/default/webdienste/basemap-webdienste.html" target="_blank">https://gdz.bkg.bund.de/index.php/default/webdienste/basemap-webdienste.html</a>';let h=r.getBackgroundLayer("backgroundLayer_"+t);h&&h.setSource(new r.ol.source.WMTS(u))})),a={title:i+" (WMTS)"}}else a={};return a}setUrlPathExtension(t){return this.url_path_extension=t,this}getUrlPathExtension(){return this.url_path_extension}getUrl(t){if(this.url_path_extension&&t){let e=this.url_path_extension+t;return e=e.replace("//","/"),e}return t}isAddFeaturePossible(){return!0}setFeatureCounter(t){return this.featureCounter=t,this}static onVisible(t,e){new IntersectionObserver(((i,r)=>{i.forEach((i=>{i.intersectionRatio>0&&(e(t),r.disconnect())}))})).observe(t)}getRGBA(t,e){let i=t.toString();return 7==i.length?"rgba("+parseInt(i.substring(1,3),16)+","+parseInt(i.substring(3,5),16)+","+parseInt(i.substring(5),16)+","+(e||1)+")":i}storeCurrentView(t){if(t&&window.confirm("Die Ansicht als Startansicht speichern?")){const e={center:this.getMap().getView().getCenter(),zoom:this.getMap().getView().getZoom(),proj:this.getMap().getView().getProjection().getCode()};fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams(e)})}}static trigger_geoposition(t){let e=document.querySelector("#"+t+"_cont .ol-geobt");return e&&e.firstElementChild?e.firstElementChild.dispatchEvent(new Event("click")):alert("Auf der angezeigten Karte steht kein GeoLocation-Control zur Verfügung."),!1}static trigger_suche(t,e){let i=document.getElementById(e);if(i&&i.dataset.address){let e=document.querySelector("#"+t+"_cont .ol-search-nominatim");if(e){e.childNodes[0].dispatchEvent(new Event("click"));let t=e.childNodes[1];t.value=i.dataset.address,t.dispatchEvent(new Event("keyup"))}else alert("Auf der angezeigten Karte steht kein Nominatim-Control zur Verfügung.")}return!1}}e.GCPortalkarteClass=n}
1,931:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GCPortalkarteEditbarClass=void 0;const r=i(5),o=i(708);class a extends r.GCPortalkarteBaseClass{constructor(t,e){super(),this.portalkarte=t,this.map=t.getMap(),this.trackingLayer=e,this.newFeatureIndex=0,this.delaySaveTimer=0,this.wktDialog=null}decodeHtml(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}encodeHTMLEntities(t){const e={" ":" ","¢":"¢","£":"£","Â¥":"¥","â¬":"€","©":"©","®":"®","<":"<",">":">",'"':""","&":"&","'":"'",ü:"ü",ä:"ä",ö:"ö",Ã:"Ü",Ã:"Ä",Ã:"Ö",Ã:"ß"};return t.replace(/[\u00A0-\u9999<>&\''\""]/gm,(t=>void 0!==e[t]?e[t]:"_"))}activateEditBar(t={}){let e=this.portalkarte,i=this;if(!e.isEditable())return null;let r={};this.jquery.extend(r,t);let n=this.trackingLayer.getSource(),s=new this.ol.control.Bar;this.map.addControl(s),this.editbar=new this.ol.control.EditBar({source:n,interactions:r,autoDeactivate:!0,toggleOne:!0,group:!1});let l=this.editbar.getActiveControls()[0];l.set("autoActivate",!1),l.setActive(!1),s.addControl(this.editbar);let u=new this.ol.Overlay.Tooltip;if(this.map.addOverlay(u),this.editbar.getInteraction("Select").on("select",(function(t){this.getFeatures().getLength()?u.setInfo("Geometrie anklicken und bearbeiten"):u.setInfo()})),this.editbar.getInteraction("Select").on("change:active",(function(t){u.setInfo("")})),r&&r.ImportWKT){let t=new this.ol.control.Toggle({className:"ol-importwkt",title:r.ImportWKT.title,name:"ImportWKT",html:'<i class="icon icon-database-insert"></i>',autoActivate:!1,onToggle:function(){i.openWKTImportDialog()}});this.editbar.addControl(t)}let d=this.editbar.getControlsByName("Select");if(d&&this.portalkarte.isEditMeta()){let t=d[0],e=this.editbar,i=new this.ol.control.Button({className:"ol-editurl",title:"URL zur ausgewählten Geometrie setzen",name:"EditUrl",html:'<i class="icon icon-circle"></i>',autoActivate:!0,handleClick:function(){e.dispatchEvent({type:"url",features:t.getInteraction().getFeatures()})}});t.getSubBar().addControl(i)}if(this.editbar.getInteraction("ModifySelect").on("modifystart",(function(t){1===t.features.length&&u.setFeature(t.features[0])})),this.editbar.getInteraction("ModifySelect").on("modifyend",(function(t){u.setFeature()})),this.editbar.getInteraction("DrawPoint")&&(this.editbar.getInteraction("DrawPoint").on("change:active",(function(t){u.setInfo(t.oldValue?"":"Klick auf die Karte setzt neuen Punkt")})),this.editbar.getInteraction("DrawPoint").on("drawend",(function(t){e.isEditMeta()&&o.GCPortalkarteEditClass.createFeatureMetadata(t,"Point","Neuer Punkt",++i.newFeatureIndex)}))),this.editbar.getControlsByName("DrawLine")){let t=this.editbar.getControlsByName("DrawLine");if(Array.isArray(t)&&t.length){let e=t[0].getSubBar().getControls();Array.isArray(e)&&e.length>=2&&(e[0].setTitle("Lösche letzten Punkt."),e[0].setHtml('<i class="icon icon-undo"></i>'),e[1].setTitle("Zeichnung abschlieÃen."),e[1].setHtml('<i class="icon icon-finish"></i>'))}}if(this.editbar.getControlsByName("DrawPolygon")){let t=this.editbar.getControlsByName("DrawPolygon");if(Array.isArray(t)&&t.length){let e=t[0].getSubBar().getControls();Array.isArray(e)&&e.length>=2&&(e[0].setTitle("Lösche letzten Punkt."),e[0].setHtml('<i class="icon icon-undo"></i>'),e[1].setTitle("Zeichnung abschlieÃen."),e[1].setHtml('<i class="icon icon-finish"></i>'))}}this.editbar.getInteraction("DrawLine")&&(this.editbar.getInteraction("DrawLine").on(["change:active","drawend"],(function(t){u.setFeature(),u.setInfo(t.oldValue?"":"Klick auf Karte startet neue Linie")})),this.editbar.getInteraction("DrawLine").on("drawstart",(function(t){u.setFeature(t.feature),u.setInfo("Klick auf Karte führt Linie weiter (Doppelklick für Ende)")})),this.editbar.getInteraction("DrawLine").on("drawend",(function(t){e.isEditMeta()&&o.GCPortalkarteEditClass.createFeatureMetadata(t,"Line","Neue Linie",++i.newFeatureIndex)}))),this.editbar.getInteraction("DrawPolygon")&&(this.editbar.getInteraction("DrawPolygon").on("drawstart",(function(t){u.setFeature(t.feature),u.setInfo("Klick auf Karte startet neues Polygon ...")})),this.editbar.getInteraction("DrawPolygon").on(["change:active","drawend"],(function(t){u.setFeature(),u.setInfo(t.oldValue?"":"Klick auf Karte führt Polygon weiter (Doppelklick für Ende)")})),this.editbar.getInteraction("DrawPolygon").on("drawend",(function(t){e.isEditMeta()&&o.GCPortalkarteEditClass.createFeatureMetadata(t,"Polygon","Neues Polygon",++i.newFeatureIndex)}))),this.editbar.getInteraction("DrawHole")&&(this.editbar.getInteraction("DrawHole").on("drawstart",(function(t){u.setFeature(t.feature),u.setInfo("Click to continue drawing hole...")})),this.editbar.getInteraction("DrawHole").on(["change:active","drawend"],(function(t){u.setFeature(),u.setInfo(t.oldValue?"":"Click polygon to start drawing hole...")}))),this.editbar.getInteraction("DrawRegular")&&(this.editbar.getInteraction("DrawRegular").on("drawstart",(function(t){u.setFeature(t.feature),u.setInfo("Klick auf die Karte beendet das Zeichnen (Umschalt-Taste gedrückt halten für gleichlange Seiten)")})),this.editbar.getInteraction("DrawRegular").on(["change:active","drawend"],(function(t){u.setFeature(),u.setInfo(t.oldValue?"":"Klick auf Karte startet neues reguläres Polygon")})),this.editbar.getInteraction("DrawRegular").on("drawend",(function(t){e.isEditMeta()&&o.GCPortalkarteEditClass.createFeatureMetadata(t,"Regular","Neues Regulär",++i.newFeatureIndex)}))),this.editbar.on("info",(function(t){if(1==t.features.getLength()){let r=i.decodeHtml(t.features.item(0).get("title")),o=prompt("Titel ändern",r);null!==o&&(o=i.encodeHTMLEntities(o),t.features.item(0).set("title",o),e.saveData())}})),this.editbar.on("url",(function(t){if(1==t.features.getLength()){let r="",o=t.features.item(0).get("flexml_geom");o&&o.url&&(r=o.url);let a=i.decodeHtml(r),n=prompt("URL setzen",a);null!==n&&(n=i.encodeHTMLEntities(n),o?o.url=n:o={url:n},t.features.item(0).set("flexml_geom",o),e.saveData())}}));let h=new this.ol.interaction.LongTouch({delay:500,handleLongTouchEvent:function(t){if(e.isAddFeaturePossible()){let r=new i.ol.Feature(new i.ol.geom.Point(t.coordinate));e.getTrackingLayer().getSource().addFeature(r),a.pulseFeature(e.getMap(),t.coordinate),setTimeout((function(){a.pulseFeature(e.getMap(),t.coordinate)}),400)}else i.setFeatureButtonState(!1)}});return h.set("interaction_type","longtouch"),this.map.addInteraction(h),n.on("featuresloadend",(function(t){})),n.on("addfeature",(function(t){e.saveData(),i.checkFeatureButtonState()})),n.on("changefeature",(function(t){i.delaySaveTimer&&clearTimeout(i.delaySaveTimer),i.delaySaveTimer=setTimeout(e.saveData,1e3,e)})),n.on("removefeature",(function(t){e.saveData(),i.checkFeatureButtonState()})),this.checkFeatureButtonState(),e.setZoomToExtentState(),this.editbar}getWKTImportDialogContent(){let t=document.getElementById("wktdialog_"+this.portalkarte.getTargetId());return t?t.innerHTML:""}openWKTImportDialog(){let t=this.portalkarte,e=this;this.wktDialog||(this.wktDialog=new this.ol.control.Dialog({content:this.getWKTImportDialogContent(),className:"wktdialog",buttons:{submit:"Ãber
1nehmen",cancel:"Verwerfen"}}),this.wktDialog.on("button",(function(i){if("submit"===i.button){let r=i.inputs.wkt.value,o=i.inputs.projection.value,a=i.inputs.wkttitle.value;if(r&&o){const n=new e.ol.format.WKT;try{const s=n.readFeature(r,{dataProjection:o,featureProjection:t.getViewProjection()});let l=e.encodeHTMLEntities(a||"Importierte WKT-Geometrie "+ ++e.newFeatureIndex);s.set("title",l),t.getTrackingLayer().getSource().addFeature(s),t.redrawExtent(),i.inputs.projection.value="EPSG:4326",i.inputs.wkt.value="",i.inputs.wkttitle.value=""}catch(i){alert("WKT konnte nicht korrekt gelesen werden. Bitte prüfen Sie den WKT und die Projektion."),console.error("WKT konnte nicht korrekt gelesen werden."),console.error(r),e.wktDialog.show()}}}else"cancel"===i.button&&(i.inputs.projection.value="EPSG:4326",i.inputs.wkt.value="",i.inputs.wkttitle.value="")})),t.getMap().addControl(this.wktDialog)),this.wktDialog.show()}getControlsByClass(t){return this.editbar.getControls().filter((function(e){return e.element&&e.element.classList.contains(t)}))}setFeatureButtonState(t){let e=null,i=["ol-drawpoint","ol-drawline","ol-drawpolygon","ol-drawregular","ol-importwkt"];for(let r=0;r<i.length;r++)e=this.getControlsByClass(i[r]),e.length&&e[0].setDisable(!t);let r=this.map.getInteractions(),o=r.getLength();for(let e=0;e<o;e++)"longtouch"===r.item(e).get("interaction_type")&&(t?r.item(e).setActive(!0):r.item(e).setActive(!1))}checkFeatureButtonState(){this.portalkarte.getMaxFeatures()>0&&(this.portalkarte.countFeatures()>=this.portalkarte.getMaxFeatures()?this.setFeatureButtonState(!1):this.setFeatureButtonState(!0))}static pulseFeature(t,e){let i=window.ol,r=new i.Feature(new i.geom.Point(e));r.setStyle(new i.style.Style({image:new i.style.Circle({radius:30,stroke:new i.style.Stroke({color:"red",width:2})})})),t.animateFeature(r,new i.featureAnimation.Zoom({fade:i.easing.easeOut,duration:800,easing:i.easing.easeOut}))}}e.GCPortalkarteEditbarClass=a}},e={};function i(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,i),a.exports}var r={};(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.GCPortalkarteEditClass=t.GCPortalkarteClass=t.factory=void 0;const e=i(861);Object.defineProperty(t,"GCPortalkarteClass",{enumerable:!0,get:function(){return e.GCPortalkarteClass}});const o=i(708);Object.defineProperty(t,"GCPortalkarteEditClass",{enumerable:!0,get:function(){return o.GCPortalkarteEditClass}}),t.factory=function(t,i,r){switch(r||(r={}),console.log("Portalkarte Version:1.0.3"),t){case"simple":case"map":return new e.GCPortalkarteClass(i,r);case"control":return new o.GCPortalkarteEditClass(i,r)}return console.error('Klasse "%s" wird nicht unterstützt!',t),null}})(),GCPortalkarte=r})(); 2//# sourceMappingURL=portalkarte.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.