qwc2 2025.10.7 → 2025.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/PrintSelection.js +3 -3
- package/components/SearchBox.js +7 -5
- package/components/StandardApp.js +1 -1
- package/components/style/SearchBox.css +2 -2
- package/components/widgets/LayerCatalogWidget.js +2 -2
- package/package.json +1 -1
- package/plugins/FeatureSearch.js +2 -2
- package/plugins/LayerCatalog.js +3 -3
- package/plugins/Map.js +1 -1
- package/plugins/Print.js +4 -4
- package/plugins/Redlining.js +3 -3
- package/plugins/TopBar.js +3 -3
- package/plugins/map/RedliningSupport.js +1 -1
- package/plugins/style/FeatureSearch.css +6 -1
- package/plugins/style/Redlining.css +5 -0
- package/reducers/redlining.js +1 -1
- package/resources/rotate.svg +70 -0
- package/static/translations/bg-BG.json +2 -3
- package/static/translations/ca-ES.json +2 -3
- package/static/translations/cs-CZ.json +2 -3
- package/static/translations/de-CH.json +2 -3
- package/static/translations/de-DE.json +2 -3
- package/static/translations/en-US.json +2 -3
- package/static/translations/es-ES.json +2 -3
- package/static/translations/fi-FI.json +2 -3
- package/static/translations/fr-FR.json +2 -3
- package/static/translations/hu-HU.json +2 -3
- package/static/translations/it-IT.json +3 -4
- package/static/translations/ja-JP.json +2 -3
- package/static/translations/nl-NL.json +2 -3
- package/static/translations/no-NO.json +2 -3
- package/static/translations/pl-PL.json +2 -3
- package/static/translations/pt-BR.json +2 -3
- package/static/translations/pt-PT.json +2 -3
- package/static/translations/ro-RO.json +2 -3
- package/static/translations/ru-RU.json +2 -3
- package/static/translations/sv-SE.json +2 -3
- package/static/translations/tr-TR.json +2 -3
- package/static/translations/tsconfig.json +1 -2
- package/static/translations/uk-UA.json +2 -3
- package/utils/EditingUtils.js +3 -2
- package/utils/SearchProviders.js +3 -3
- package/utils/VectorLayerUtils.js +1 -1
package/plugins/Print.js
CHANGED
|
@@ -8,9 +8,9 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
8
8
|
* Invokes QGIS Server WMS GetPrint to print the map to PDF.
|
|
9
9
|
*
|
|
10
10
|
* Uses the print layouts defined in the QGIS project.
|
|
11
|
-
*/var Print=/*#__PURE__*/function(_React$Component){function Print(props){var _this;_classCallCheck(this,Print);_this=_callSuper(this,Print,[props]);_defineProperty(_this,"state",{center:null,extents:[],layout:null,layouts:[],rotation:0,scale:0,dpi:300,grid:false,legend:false,minimized:false,printOutputVisible:false,outputLoaded:false,printing:false,atlasFeatures:[],geoPdf:false,selectedFormat:"",printOutputData:undefined,pdfData:null,pdfDataUrl:null,downloadMode:"onepdf",printSeriesEnabled:false,printSeriesOverlap:0,printSeriesSelected:[]});_defineProperty(_this,"onShow",function(){
|
|
12
|
-
var scale=Math.round(MapUtils.computeForZoom(_this.props.map.scales,_this.props.map.zoom)*_this.props.defaultScaleFactor);if(_this.props.theme.printScales&&_this.props.theme.printScales.length>0){var closestVal=Math.abs(scale-_this.props.theme.printScales[0]);var closestIdx=0;for(var i=1;i<_this.props.theme.printScales.length;++i){var currVal=Math.abs(scale-_this.props.theme.printScales[i]);if(currVal<closestVal){closestVal=currVal;closestIdx=i}}scale=_this.props.theme.printScales[closestIdx]}var bounds=_this.props.map.bbox.bounds;var center=_this.state.center||[0,0];var resetCenter=center[0]<bounds[0]||center[0]>bounds[2]||center[1]<bounds[1]||center[1]>bounds[3];var resetScale=_this.state.scale/scale<0.01||_this.state.scale/scale>10;if(resetCenter||resetScale){_this.setState({center:null,rotation:0,scale:scale})}_this.props.setSnappingConfig(false,false)});_defineProperty(_this,"onHide",function(){_this.setState({minimized:false,printSeriesEnabled:false,atlasFeatures:[]})});_defineProperty(_this,"renderBody",function(){var _this$state$extents$a,_this$state$layout$la,_this$state$layout;if(!_this.state.layout){return/*#__PURE__*/React.createElement("div",{className:"print-body",role:"body"},LocaleUtils.tr("print.nolayouts"))}var haveThemeLayers=_this.props.layers.find(function(layer){return layer.role===LayerRole.THEME})!==undefined;if(!_this.props.theme||!_this.props.printExternalLayers&&!haveThemeLayers){return/*#__PURE__*/React.createElement("div",{className:"print-body",role:"body"},LocaleUtils.tr("print.notheme"))}var mapName=_this.state.layout.map.name;var printLegend=_this.state.layout.legendLayout;var formattedExtent=!isEmpty(_this.state.atlasFeatures)?"":_this.formatExtent((_this$state$extents$a=_this.state.extents.at(0))!==null&&_this$state$extents$a!==void 0?_this$state$extents$a:[0,0,0,0]);var resolutionChooser=null;var resolutionInput=null;if(!isEmpty(_this.props.theme.printResolutions)){if(_this.props.theme.printResolutions.length>1){resolutionChooser=/*#__PURE__*/React.createElement("select",{name:"DPI",onChange:function onChange(ev){return _this.changeResolution(ev.target.value)},value:_this.state.dpi||""},_this.props.theme.printResolutions.map(function(res){return/*#__PURE__*/React.createElement("option",{key:res,value:res},res," dpi")}))}else{resolutionInput=/*#__PURE__*/React.createElement("input",{name:"DPI",readOnly:true,type:"hidden",value:_this.props.theme.printResolutions[0]})}}else{resolutionChooser=/*#__PURE__*/React.createElement(NumberInput,{max:1200,min:50,mobile:true,name:"DPI",onChange:_this.changeResolution,suffix:" dpi",value:_this.state.dpi||""})}var formatMap={"application/pdf":"PDF","image/jpeg":"JPEG","image/png":"PNG","image/svg":"SVG"};var allowGeoPdfExport=_this.state.selectedFormat==="application/pdf"&&_this.props.allowGeoPdfExport;return/*#__PURE__*/React.createElement("div",{className:"print-body"},/*#__PURE__*/React.createElement("form",{action:_this.props.theme.printUrl,method:"POST",onSubmit:_this.print,ref:function ref(el){_this.printForm=el}},/*#__PURE__*/React.createElement("input",{name:"TEMPLATE",type:"hidden",value:printLegend&&_this.state.legend?printLegend:_this.state.layout.name}),/*#__PURE__*/React.createElement("table",{className:"options-table"},/*#__PURE__*/React.createElement("tbody",null,/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.layout")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{onChange:_this.changeLayout,value:_this.state.layout.name},_this.state.layouts.map(function(item){return/*#__PURE__*/React.createElement("option",{key:item.name,value:item.name},_this.translateLayoutName(item.name))})))),_this.props.formats.length>1?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.format")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{disabled:_this.state.printSeriesEnabled,name:"FORMAT",onChange:_this.formatChanged,value:_this.state.selectedFormat},_this.props.formats.map(function(format){return/*#__PURE__*/React.createElement("option",{key:format,value:format},formatMap[format]||format)})))):null,_this.state.layout.atlasCoverageLayer&&!_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.atlasfeature")),/*#__PURE__*/React.createElement("td",null,!isEmpty(_this.state.atlasFeatures)?/*#__PURE__*/React.createElement("div",{className:"print-atlas-features"},_this.state.atlasFeatures.map(function(feature){return/*#__PURE__*/React.createElement("span",{key:feature.id},/*#__PURE__*/React.createElement("span",null,feature.properties[feature.displayfield]),/*#__PURE__*/React.createElement(Icon,{icon:"remove",onClick:function onClick(){return _this.deselectAtlasFeature(feature)}}))}),/*#__PURE__*/React.createElement("input",{name:"ATLAS_PK",type:"hidden",value:_this.state.atlasFeatures.map(function(feature){var _feature$properties$_;return(_feature$properties$_=feature.properties[_this.state.layout.atlas_pk])!==null&&_feature$properties$_!==void 0?_feature$properties$_:feature.id}).join(",")})):/*#__PURE__*/React.createElement("input",{disabled:true,placeholder:LocaleUtils.tr("print.pickatlasfeature",_this.state.layout.atlasCoverageLayer),type:"text"}))):null,isEmpty(_this.state.atlasFeatures)?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.scale")),/*#__PURE__*/React.createElement("td",null,!isEmpty(_this.props.theme.printScales)?/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement("span",{role:"prefix"},"1\xA0:\xA0"),/*#__PURE__*/React.createElement(EditableSelect,{name:mapName+":scale",onChange:_this.changeScale,options:_this.props.theme.printScales,role:"input",value:_this.state.scale||""})):/*#__PURE__*/React.createElement(NumberInput,{min:1,mobile:true,name:mapName+":scale",onChange:_this.changeScale,prefix:"1 : ",value:_this.state.scale||null}))):null,resolutionChooser?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.resolution")),/*#__PURE__*/React.createElement("td",null,resolutionChooser)):null,_this.props.displayRotation?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.rotation")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement(NumberInput,{decimals:1,mobile:true,name:mapName+":rotation",onChange:_this.changeRotation,role:"input",value:_this.state.rotation}),/*#__PURE__*/React.createElement("span",{role:"suffix",style:{transform:"rotate(-"+_this.state.rotation+"deg)"}},/*#__PURE__*/React.createElement(Icon,{icon:"arrow-up",onClick:function onClick(){return _this.setState({rotation:0})},title:LocaleUtils.tr("map.resetrotation")}))))):null,!isEmpty(_this.props.theme.printGrid)?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.grid")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.grid,onChange:function onChange(newstate){return _this.setState({grid:newstate})}}))):null,printLegend?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.legend")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.legend,onChange:function onChange(newstate){return _this.setState({legend:newstate})}}))):null,_this.props.displayPrintSeries?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.series")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.printSeriesEnabled,onChange:function onChange(newstate){return _this.setState({printSeriesEnabled:newstate,atlasFeatures:[]})}}))):null,_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.overlap")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement("input",{max:"20",min:"0",onChange:_this.changeSeriesOverlap,role:"input",type:"range",value:_this.state.printSeriesOverlap}),/*#__PURE__*/React.createElement("span",{role:"suffix"},_this.state.printSeriesOverlap,"\xA0%")))):null,!_this.props.inlinePrintOutput&&_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.download")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{onChange:_this.changeDownloadMode,role:"input",value:_this.state.downloadMode||""},/*#__PURE__*/React.createElement("option",{key:"onepdf",value:"onepdf"},LocaleUtils.tr("print.download_as_onepdf")),/*#__PURE__*/React.createElement("option",{key:"onezip",value:"onezip"},LocaleUtils.tr("print.download_as_onezip")),/*#__PURE__*/React.createElement("option",{key:"single",value:"single"},LocaleUtils.tr("print.download_as_single"))))):null,((_this$state$layout$la=(_this$state$layout=_this.state.layout)===null||_this$state$layout===void 0?void 0:_this$state$layout.labels)!==null&&_this$state$layout$la!==void 0?_this$state$layout$la:[]).map(function(label){var _this$props$theme$pri;// Omit labels which start with __
|
|
13
|
-
if(label.startsWith("__")){return null}var opts=_objectSpread({rows:1,name:label.toUpperCase()},(_this$props$theme$
|
|
11
|
+
*/var Print=/*#__PURE__*/function(_React$Component){function Print(props){var _this;_classCallCheck(this,Print);_this=_callSuper(this,Print,[props]);_defineProperty(_this,"state",{center:null,extents:[],layout:null,layouts:[],rotation:0,scale:0,dpi:300,grid:false,legend:false,minimized:false,printOutputVisible:false,outputLoaded:false,printing:false,atlasFeatures:[],geoPdf:false,selectedFormat:"",printOutputData:undefined,pdfData:null,pdfDataUrl:null,downloadMode:"onepdf",printSeriesEnabled:false,printSeriesOverlap:0,printSeriesSelected:[]});_defineProperty(_this,"onShow",function(){var _this$props$theme$pri;// setup initial extent
|
|
12
|
+
var scale=Math.round(MapUtils.computeForZoom(_this.props.map.scales,_this.props.map.zoom)*_this.props.defaultScaleFactor);if(((_this$props$theme$pri=_this.props.theme.printScales)===null||_this$props$theme$pri===void 0?void 0:_this$props$theme$pri.length)>0){scale=_this.props.theme.printScales.reduce(function(prev,curr){return Math.abs(curr-scale)<Math.abs(prev-scale)?curr:prev})}var bounds=_this.props.map.bbox.bounds;var center=_this.state.center||[0,0];var resetCenter=center[0]<bounds[0]||center[0]>bounds[2]||center[1]<bounds[1]||center[1]>bounds[3];var resetScale=_this.state.scale/scale<0.01||_this.state.scale/scale>10;if(resetCenter||resetScale){_this.setState({center:null,rotation:0,scale:scale})}_this.props.setSnappingConfig(false,false)});_defineProperty(_this,"onHide",function(){_this.setState({minimized:false,printSeriesEnabled:false,atlasFeatures:[]})});_defineProperty(_this,"renderBody",function(){var _this$state$extents$a,_this$props$theme$pri2,_this$state$layout$la,_this$state$layout;if(!_this.state.layout){return/*#__PURE__*/React.createElement("div",{className:"print-body",role:"body"},LocaleUtils.tr("print.nolayouts"))}var haveThemeLayers=_this.props.layers.find(function(layer){return layer.role===LayerRole.THEME})!==undefined;if(!_this.props.theme||!_this.props.printExternalLayers&&!haveThemeLayers){return/*#__PURE__*/React.createElement("div",{className:"print-body",role:"body"},LocaleUtils.tr("print.notheme"))}var mapName=_this.state.layout.map.name;var printLegend=_this.state.layout.legendLayout;var formattedExtent=!isEmpty(_this.state.atlasFeatures)?"":_this.formatExtent((_this$state$extents$a=_this.state.extents.at(0))!==null&&_this$state$extents$a!==void 0?_this$state$extents$a:[0,0,0,0]);var resolutionChooser=null;var resolutionInput=null;if(!isEmpty(_this.props.theme.printResolutions)){if(_this.props.theme.printResolutions.length>1){resolutionChooser=/*#__PURE__*/React.createElement("select",{name:"DPI",onChange:function onChange(ev){return _this.changeResolution(ev.target.value)},value:_this.state.dpi||""},_this.props.theme.printResolutions.map(function(res){return/*#__PURE__*/React.createElement("option",{key:res,value:res},res," dpi")}))}else{resolutionInput=/*#__PURE__*/React.createElement("input",{name:"DPI",readOnly:true,type:"hidden",value:_this.props.theme.printResolutions[0]})}}else{resolutionChooser=/*#__PURE__*/React.createElement(NumberInput,{max:1200,min:50,mobile:true,name:"DPI",onChange:_this.changeResolution,suffix:" dpi",value:_this.state.dpi||""})}var scaleChooser=null;if(((_this$props$theme$pri2=_this.props.theme.printScales)===null||_this$props$theme$pri2===void 0?void 0:_this$props$theme$pri2.length)>0){if(_this.props.restrictToPrintScales){scaleChooser=/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement("span",{role:"prefix"},"1\xA0:\xA0"),/*#__PURE__*/React.createElement("select",{name:mapName+":scale",onChange:function onChange(ev){return _this.changeScale(ev.target.value)},role:"input",value:_this.state.scale},_this.props.theme.printScales.map(function(scale){return/*#__PURE__*/React.createElement("option",{key:scale,value:scale},scale)})))}else{scaleChooser=/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement("span",{role:"prefix"},"1\xA0:\xA0"),/*#__PURE__*/React.createElement(EditableSelect,{name:mapName+":scale",onChange:_this.changeScale,options:_this.props.theme.printScales,role:"input",value:_this.state.scale||""}))}}else{scaleChooser=/*#__PURE__*/React.createElement(NumberInput,{min:1,mobile:true,name:mapName+":scale",onChange:_this.changeScale,prefix:"1 : ",value:_this.state.scale||null})}var formatMap={"application/pdf":"PDF","image/jpeg":"JPEG","image/png":"PNG","image/svg":"SVG"};var allowGeoPdfExport=_this.state.selectedFormat==="application/pdf"&&_this.props.allowGeoPdfExport;return/*#__PURE__*/React.createElement("div",{className:"print-body"},/*#__PURE__*/React.createElement("form",{action:_this.props.theme.printUrl,method:"POST",onSubmit:_this.print,ref:function ref(el){_this.printForm=el}},/*#__PURE__*/React.createElement("input",{name:"TEMPLATE",type:"hidden",value:printLegend&&_this.state.legend?printLegend:_this.state.layout.name}),/*#__PURE__*/React.createElement("table",{className:"options-table"},/*#__PURE__*/React.createElement("tbody",null,/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.layout")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{onChange:_this.changeLayout,value:_this.state.layout.name},_this.state.layouts.map(function(item){return/*#__PURE__*/React.createElement("option",{key:item.name,value:item.name},_this.translateLayoutName(item.name))})))),_this.props.formats.length>1?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.format")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{disabled:_this.state.printSeriesEnabled,name:"FORMAT",onChange:_this.formatChanged,value:_this.state.selectedFormat},_this.props.formats.map(function(format){return/*#__PURE__*/React.createElement("option",{key:format,value:format},formatMap[format]||format)})))):null,_this.state.layout.atlasCoverageLayer&&!_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.atlasfeature")),/*#__PURE__*/React.createElement("td",null,!isEmpty(_this.state.atlasFeatures)?/*#__PURE__*/React.createElement("div",{className:"print-atlas-features"},_this.state.atlasFeatures.map(function(feature){return/*#__PURE__*/React.createElement("span",{key:feature.id},/*#__PURE__*/React.createElement("span",null,feature.properties[feature.displayfield]),/*#__PURE__*/React.createElement(Icon,{icon:"remove",onClick:function onClick(){return _this.deselectAtlasFeature(feature)}}))}),/*#__PURE__*/React.createElement("input",{name:"ATLAS_PK",type:"hidden",value:_this.state.atlasFeatures.map(function(feature){var _feature$properties$_;return(_feature$properties$_=feature.properties[_this.state.layout.atlas_pk])!==null&&_feature$properties$_!==void 0?_feature$properties$_:feature.id}).join(",")})):/*#__PURE__*/React.createElement("input",{disabled:true,placeholder:LocaleUtils.tr("print.pickatlasfeature",_this.state.layout.atlasCoverageLayer),type:"text"}))):null,isEmpty(_this.state.atlasFeatures)?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.scale")),/*#__PURE__*/React.createElement("td",null,scaleChooser)):null,resolutionChooser?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.resolution")),/*#__PURE__*/React.createElement("td",null,resolutionChooser)):null,_this.props.displayRotation?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.rotation")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement(NumberInput,{decimals:1,mobile:true,name:mapName+":rotation",onChange:_this.changeRotation,role:"input",value:_this.state.rotation}),/*#__PURE__*/React.createElement("span",{role:"suffix",style:{transform:"rotate(-"+_this.state.rotation+"deg)"}},/*#__PURE__*/React.createElement(Icon,{icon:"arrow-up",onClick:function onClick(){return _this.setState({rotation:0})},title:LocaleUtils.tr("map.resetrotation")}))))):null,!isEmpty(_this.props.theme.printGrid)?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.grid")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.grid,onChange:function onChange(newstate){return _this.setState({grid:newstate})}}))):null,printLegend?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.legend")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.legend,onChange:function onChange(newstate){return _this.setState({legend:newstate})}}))):null,_this.props.displayPrintSeries?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.series")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.printSeriesEnabled,onChange:function onChange(newstate){return _this.setState({printSeriesEnabled:newstate,atlasFeatures:[]})}}))):null,_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.overlap")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(InputContainer,null,/*#__PURE__*/React.createElement("input",{max:"20",min:"0",onChange:_this.changeSeriesOverlap,role:"input",type:"range",value:_this.state.printSeriesOverlap}),/*#__PURE__*/React.createElement("span",{role:"suffix"},_this.state.printSeriesOverlap,"\xA0%")))):null,!_this.props.inlinePrintOutput&&_this.state.printSeriesEnabled?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,LocaleUtils.tr("print.download")),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{onChange:_this.changeDownloadMode,role:"input",value:_this.state.downloadMode||""},/*#__PURE__*/React.createElement("option",{key:"onepdf",value:"onepdf"},LocaleUtils.tr("print.download_as_onepdf")),/*#__PURE__*/React.createElement("option",{key:"onezip",value:"onezip"},LocaleUtils.tr("print.download_as_onezip")),/*#__PURE__*/React.createElement("option",{key:"single",value:"single"},LocaleUtils.tr("print.download_as_single"))))):null,((_this$state$layout$la=(_this$state$layout=_this.state.layout)===null||_this$state$layout===void 0?void 0:_this$state$layout.labels)!==null&&_this$state$layout$la!==void 0?_this$state$layout$la:[]).map(function(label){var _this$props$theme$pri3;// Omit labels which start with __
|
|
13
|
+
if(label.startsWith("__")){return null}var opts=_objectSpread({rows:1,name:label.toUpperCase()},(_this$props$theme$pri3=_this.props.theme.printLabelConfig)===null||_this$props$theme$pri3===void 0?void 0:_this$props$theme$pri3[label]);return _this.renderPrintLabelField(label,opts)}),allowGeoPdfExport?/*#__PURE__*/React.createElement("tr",null,/*#__PURE__*/React.createElement("td",null,"GeoPDF"),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement(ToggleSwitch,{active:_this.state.geoPdf,onChange:function onChange(newstate){return _this.setState({geoPdf:newstate})}}))):null)),/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("input",{name:"csrf_token",type:"hidden",value:MiscUtils.getCsrfToken()}),/*#__PURE__*/React.createElement("input",{name:mapName+":extent",readOnly:true,type:"hidden",value:formattedExtent}),/*#__PURE__*/React.createElement("input",{name:"SERVICE",readOnly:true,type:"hidden",value:"WMS"}),/*#__PURE__*/React.createElement("input",{name:"VERSION",readOnly:true,type:"hidden",value:_this.props.theme.version}),/*#__PURE__*/React.createElement("input",{name:"REQUEST",readOnly:true,type:"hidden",value:"GetPrint"}),/*#__PURE__*/React.createElement("input",{name:"FORMAT",readOnly:true,type:"hidden",value:_this.state.selectedFormat}),/*#__PURE__*/React.createElement("input",{name:"TRANSPARENT",readOnly:true,type:"hidden",value:"true"}),/*#__PURE__*/React.createElement("input",{name:"SRS",readOnly:true,type:"hidden",value:_this.props.map.projection}),/*#__PURE__*/React.createElement("input",{name:"CONTENT_DISPOSITION",readOnly:true,type:"hidden",value:_this.props.inlinePrintOutput?"inline":"attachment"}),allowGeoPdfExport?/*#__PURE__*/React.createElement("input",{name:"FORMAT_OPTIONS",readOnly:true,type:"hidden",value:_this.state.geoPdf?"WRITE_GEO_PDF:true":"WRITE_GEO_PDF:false"}):null,resolutionInput),/*#__PURE__*/React.createElement("div",{className:"button-bar"},/*#__PURE__*/React.createElement("button",{className:"button",disabled:_this.state.printing,type:"submit"},_this.state.printing?/*#__PURE__*/React.createElement("span",{className:"print-wait"},/*#__PURE__*/React.createElement(Spinner,null)," ",LocaleUtils.tr("print.wait")):LocaleUtils.tr("print.submit")))))});_defineProperty(_this,"renderPrintLabelField",function(label,opts){var defaultValue=opts.defaultValue||"";var autopopulated=false;if(label===_this.props.theme.printLabelForSearchResult){defaultValue=_this.getSearchMarkerLabel();autopopulated=true}else if(label===_this.props.theme.printLabelForAttribution){defaultValue=_this.getAttributionLabel();autopopulated=true}if(autopopulated&&_this.props.hideAutopopulatedFields){return/*#__PURE__*/React.createElement("tr",{key:"label."+label},/*#__PURE__*/React.createElement("td",{colSpan:"2"},/*#__PURE__*/React.createElement("input",{defaultValue:defaultValue,name:opts.name,type:"hidden"})))}else{if(opts.options){return/*#__PURE__*/React.createElement("tr",{key:"label."+label},/*#__PURE__*/React.createElement("td",null,MiscUtils.capitalizeFirst(label)),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("select",{defaultValue:defaultValue,name:opts.name},opts.options.map(function(value){return/*#__PURE__*/React.createElement("option",{key:value,value:value},value)}))))}else{var style={};if(opts.rows||opts.cols){style.resize="none"}if(opts.cols){style.width="initial"}return/*#__PURE__*/React.createElement("tr",{key:"label."+label},/*#__PURE__*/React.createElement("td",null,MiscUtils.capitalizeFirst(label)),/*#__PURE__*/React.createElement("td",null,/*#__PURE__*/React.createElement("textarea",_extends({},opts,{defaultValue:defaultValue,readOnly:autopopulated,style:style}))))}}});_defineProperty(_this,"getSearchMarkerLabel",function(){var _feature$properties;var searchsellayer=_this.props.layers.find(function(layer){return layer.id==="searchselection"});var feature=((searchsellayer===null||searchsellayer===void 0?void 0:searchsellayer.features)||[]).find(function(f){return f.id==="searchmarker"});return(feature===null||feature===void 0||(_feature$properties=feature.properties)===null||_feature$properties===void 0?void 0:_feature$properties.label)||""});_defineProperty(_this,"getAttributionLabel",function(){var copyrights=_this.props.layers.reduce(function(res,layer){return _objectSpread(_objectSpread({},res),LayerUtils.getAttribution(layer,_this.props.map))},{});var el=document.createElement("span");return Object.entries(copyrights).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];if(value.title){el.innerHTML=value.title;return el.innerText}else{el.innerHTML=key;return el.innerText}}).join(" | ")});_defineProperty(_this,"renderPrintSelection",function(){var printSelection=null;if(_this.state.layout&&isEmpty(_this.state.atlasFeatures)){var frame={width:_this.state.layout.map.width,height:_this.state.layout.map.height};printSelection=/*#__PURE__*/React.createElement(PrintSelection,{allowRotation:_this.props.displayRotation&&(!_this.state.printSeriesEnabled||_this.props.movePrintSeries),allowScaling:!_this.state.printSeriesEnabled||_this.props.movePrintSeries,allowTranslation:!_this.state.printSeriesEnabled||_this.props.movePrintSeries,center:_this.state.center||_this.props.map.center,fixedFrame:frame,geometryChanged:_this.geometryChanged,key:"PrintSelection",printSeriesChanged:_this.printSeriesChanged,printSeriesEnabled:_this.props.displayPrintSeries&&_this.state.printSeriesEnabled,printSeriesOverlap:_this.state.printSeriesOverlap/100,printSeriesSelected:_this.state.printSeriesSelected,rotation:_this.state.rotation,scale:_this.state.scale})}return printSelection});_defineProperty(_this,"formatExtent",function(extent){var mapCrs=_this.props.map.projection;var version=_this.props.theme.version;if(CoordinatesUtils.getAxisOrder(mapCrs).substring(0,2)==="ne"&&version==="1.3.0"){return extent[1]+","+extent[0]+","+extent[3]+","+extent[2]}return extent.join(",")});_defineProperty(_this,"geometryChanged",function(center,extents,rotation,scale){var _this$props$theme$pri4;if(_this.props.restrictToPrintScales&&((_this$props$theme$pri4=_this.props.theme.printScales)===null||_this$props$theme$pri4===void 0?void 0:_this$props$theme$pri4.length)>0){scale=_this.props.theme.printScales.reduce(function(prev,curr){return Math.abs(curr-scale)<Math.abs(prev-scale)?curr:prev})}_this.setState({center:center,extents:extents,rotation:rotation,scale:scale})});_defineProperty(_this,"printSeriesChanged",function(selected){_this.setState({printSeriesSelected:selected})});_defineProperty(_this,"renderPrintOutputWindow",function(){var extraControls=[{icon:"save",title:LocaleUtils.tr("print.save"),callback:_this.savePrintOutput}];return/*#__PURE__*/React.createElement(ResizeableWindow,{extraControls:extraControls,icon:"print",initialHeight:0.75*window.innerHeight,initialWidth:0.5*window.innerWidth,key:"PrintOutputWindow",onClose:function onClose(){return _this.setState({printOutputVisible:false,outputLoaded:false,pdfData:null,pdfDataUrl:null})},title:LocaleUtils.tr("print.output"),visible:_this.state.printOutputVisible},/*#__PURE__*/React.createElement("div",{className:"print-output-window-body",role:"body"},!_this.state.outputLoaded?/*#__PURE__*/React.createElement("span",{className:"print-output-window-wait"},/*#__PURE__*/React.createElement(Spinner,null)," ",LocaleUtils.tr("print.wait")):null,/*#__PURE__*/React.createElement("iframe",{name:"print-output-window",src:_this.state.pdfDataUrl})))});_defineProperty(_this,"savePrintOutput",function(){FileSaver.saveAs(_this.state.pdfData.content,_this.state.pdfData.fileName)});_defineProperty(_this,"selectAtlasFeature",function(layer,feature){if(!feature){return}_this.setState(function(state){var index=state.atlasFeatures.findIndex(function(f){return f.id===feature.id});if(index>=0){var newAtlasFeatures=state.atlasFeatures.slice(0);newAtlasFeatures.splice(index,1);return{atlasFeatures:newAtlasFeatures}}else{return{atlasFeatures:[].concat(_toConsumableArray(state.atlasFeatures),[feature])}}})});_defineProperty(_this,"deselectAtlasFeature",function(feature){_this.setState(function(state){var index=state.atlasFeatures.find(function(f){return f.id===feature.id});var newAtlasFeatures=state.atlasFeatures.slice(0);newAtlasFeatures.splice(index,1);return{atlasFeatures:newAtlasFeatures}})});_defineProperty(_this,"changeLayout",function(ev){var layout=_this.props.theme.print.find(function(item){return item.name===ev.target.value});_this.setState({layout:layout,atlasFeature:null})});_defineProperty(_this,"changeScale",function(value){_this.setState({scale:Math.max(1,parseInt(value,10)||0)})});_defineProperty(_this,"changeResolution",function(value){_this.setState({dpi:value||300})});_defineProperty(_this,"changeRotation",function(value){var angle=value||0;_this.setState({rotation:(angle%360+360)%360})});_defineProperty(_this,"changeSeriesOverlap",function(ev){_this.setState({printSeriesOverlap:parseInt(ev.target.value,10)||0})});_defineProperty(_this,"changeDownloadMode",function(ev){_this.setState({downloadMode:ev.target.value})});_defineProperty(_this,"formatChanged",function(ev){_this.setState({selectedFormat:ev.target.value})});_defineProperty(_this,"print",function(ev){ev.preventDefault();_this.setState({printing:true});if(_this.props.inlinePrintOutput){_this.setState({printOutputVisible:true,outputLoaded:false,pdfDataUrl:null,pdfData:null})}var formData=formDataEntries(new FormData(_this.printForm));var mapCrs=_this.props.map.projection;var mapName=_this.state.layout.map.name;// Add base print params
|
|
14
14
|
var printParams=LayerUtils.collectPrintParams(_this.props.layers,_this.props.theme,_this.state.scale,mapCrs,_this.props.printExternalLayers);Object.entries(printParams).forEach(function(_ref3){var _ref4=_slicedToArray(_ref3,2),key=_ref4[0],value=_ref4[1];formData[key]=value});formData[mapName+":LAYERS"]=printParams.LAYERS;formData[mapName+":STYLES"]=printParams.STYLES;formData[mapName+":FILTER"]=printParams.FILTER;formData[mapName+":FILTER_GEOM"]=printParams.FILTER_GEOM;// Add highlight params
|
|
15
15
|
var printDpi=parseInt(_this.state.dpi,10)||0;if(_this.props.printMapHighlights){var highlightParams=VectorLayerUtils.createPrintHighlighParams(_this.props.layers,mapCrs,_this.state.scale,printDpi,_this.props.scaleFactor);formData[mapName+":HIGHLIGHT_GEOM"]=highlightParams.geoms.join(";");formData[mapName+":HIGHLIGHT_SYMBOL"]=highlightParams.styles.join(";");formData[mapName+":HIGHLIGHT_LABELSTRING"]=highlightParams.labels.join(";");formData[mapName+":HIGHLIGHT_LABELCOLOR"]=highlightParams.labelFillColors.join(";");formData[mapName+":HIGHLIGHT_LABELBUFFERCOLOR"]=highlightParams.labelOutlineColors.join(";");formData[mapName+":HIGHLIGHT_LABELBUFFERSIZE"]=highlightParams.labelOutlineSizes.join(";");formData[mapName+":HIGHLIGHT_LABELSIZE"]=highlightParams.labelSizes.join(";");formData[mapName+":HIGHLIGHT_LABEL_DISTANCE"]=highlightParams.labelDist.join(";");formData[mapName+":HIGHLIGHT_LABEL_ROTATION"]=highlightParams.labelRotations.join(";")}// Add grid params
|
|
16
16
|
var printGrid=_this.props.theme.printGrid;if(!isEmpty(printGrid)){if(_this.state.grid){var cur=0;while(cur<printGrid.length-1&&_this.state.scale<printGrid[cur].s){cur+=1}formData[mapName+":GRID_INTERVAL_X"]=printGrid[cur].x;formData[mapName+":GRID_INTERVAL_Y"]=printGrid[cur].y}else{formData[mapName+":GRID_INTERVAL_X"]=0;formData[mapName+":GRID_INTERVAL_Y"]=0}}// Add dimension values
|
|
@@ -19,5 +19,5 @@ var extraOptions=Object.fromEntries((_this.props.theme.extraPrintParameters||"")
|
|
|
19
19
|
_this.batchPrint(pages,fileName)["catch"](function(e){_this.setState({outputLoaded:true,printOutputVisible:false});if(e.response){/* eslint-disable-next-line */console.warn(new TextDecoder().decode(e.response.data))}/* eslint-disable-next-line */alert("Print failed")})["finally"](function(){_this.setState({printing:false})})});_defineProperty(_this,"translateLayoutName",function(name){var _this$props$theme$tra,_this$props$theme$tra2;return(_this$props$theme$tra=(_this$props$theme$tra2=_this.props.theme.translations)===null||_this$props$theme$tra2===void 0||(_this$props$theme$tra2=_this$props$theme$tra2.layouts)===null||_this$props$theme$tra2===void 0?void 0:_this$props$theme$tra2[name])!==null&&_this$props$theme$tra!==void 0?_this$props$theme$tra:name});_this.printForm=null;_this.state.grid=props.gridInitiallyEnabled;_this.state.dpi=props.defaultDpi;_this.state.selectedFormat=props.formats[0];return _this}_inherits(Print,_React$Component);return _createClass(Print,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){var _this2=this;if(prevProps.theme!==this.props.theme){if(this.props.theme&&!isEmpty(this.props.theme.print)){var sortDir=this.props.layoutSortOrder==="desc"?-1:1;var layouts=this.props.theme.print.filter(function(l){return l.map&&!l.name.split("/").pop().startsWith(_this2.props.layoutHidePrefix)}).sort(function(a,b){return sortDir*a.name.split("/").pop().localeCompare(b.name.split("/").pop(),undefined,{numeric:true})});var layout=layouts.find(function(l){return l["default"]})||layouts[0];this.setState({layouts:layouts,layout:layout,atlasFeatures:[]})}else{this.setState({layouts:[],layout:null,atlasFeatures:[]})}}if(this.state.atlasFeatures!==prevState.atlasFeatures){if(!isEmpty(this.state.atlasFeatures)){var layer={id:"print-pick-selection",role:LayerRole.SELECTION,skipPrint:true};this.props.addLayerFeatures(layer,this.state.atlasFeatures,true)}else if(!isEmpty(prevState.atlasFeatures)){this.props.clearLayer("print-pick-selection")}}if(this.state.printSeriesEnabled&&this.state.selectedFormat!=="application/pdf"){this.setState({selectedFormat:"application/pdf"})}}},{key:"render",value:function render(){var _this3=this;var minMaxTooltip=this.state.minimized?LocaleUtils.tr("print.maximize"):LocaleUtils.tr("print.minimize");var extraTitlebarContent=/*#__PURE__*/React.createElement(Icon,{className:"print-minimize-maximize",icon:this.state.minimized?"chevron-down":"chevron-up",onClick:function onClick(){return _this3.setState(function(state){return{minimized:!state.minimized}})},title:minMaxTooltip});var themeLayer=this.props.layers.find(function(layer){return layer.role===LayerRole.THEME});return[/*#__PURE__*/React.createElement(SideBar,{extraTitlebarContent:extraTitlebarContent,icon:"print",id:"Print",key:"Print",onHide:this.onHide,onShow:this.onShow,side:this.props.side,title:LocaleUtils.tr("appmenu.items.Print"),width:"20em"},function(){return{body:_this3.state.minimized?null:_this3.renderBody(),extra:[_this3.renderPrintSelection()]}}),this.renderPrintOutputWindow(),this.props.active&&this.state.layout&&this.state.layout.atlasCoverageLayer&&!this.state.printSeriesEnabled?/*#__PURE__*/React.createElement(PickFeature,{featurePicked:this.selectAtlasFeature,key:"FeaturePicker",layerFilter:{url:themeLayer===null||themeLayer===void 0?void 0:themeLayer.url,name:this.state.layout.atlasCoverageLayer}}):null]}},{key:"batchPrint",value:function(){var _batchPrint=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(pages,fileName){var _this4=this;var promises,docs,files,file,fileURL,_iterator,_step,_file;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:// Print pages on server
|
|
20
20
|
promises=pages.map(function(formData){return _this4.printRequest(formData)});// Collect printing results
|
|
21
21
|
_context.next=3;return Promise.all(promises);case 3:docs=_context.sent;_context.next=6;return this.collectFiles(docs,fileName);case 6:files=_context.sent;// Download or display files
|
|
22
|
-
if(this.props.inlinePrintOutput&&files.length===1){file=files.pop();fileURL=URL.createObjectURL(file.content);this.setState({pdfData:file,pdfDataUrl:fileURL,outputLoaded:true})}else{_iterator=_createForOfIteratorHelper(files);try{for(_iterator.s();!(_step=_iterator.n()).done;){_file=_step.value;FileSaver.saveAs(_file.content,_file.fileName)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}case 8:case"end":return _context.stop()}},_callee,this)}));function batchPrint(_x,_x2){return _batchPrint.apply(this,arguments)}return batchPrint}()},{key:"printRequest",value:function(){var _printRequest=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formData){var data,config,response,contentType;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:data=Object.entries(formData).map(function(pair){return pair.map(function(entry){return encodeURIComponent(entry).replace(/%20/g,"+")}).join("=")}).join("&");config={headers:{"Content-Type":"application/x-www-form-urlencoded"},responseType:"arraybuffer"};_context2.next=4;return axios.post(this.props.theme.printUrl,data,config);case 4:response=_context2.sent;contentType=response.headers["content-type"];return _context2.abrupt("return",{name:formData.name,data:response.data,contentType:contentType});case 7:case"end":return _context2.stop()}},_callee2,this)}));function printRequest(_x3){return _printRequest.apply(this,arguments)}return printRequest}()},{key:"collectFiles",value:function(){var _collectFiles=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(docs,fileName){var _this5=this;var data,content,_data,_content;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(docs.length>1&&this.state.downloadMode==="onepdf")){_context3.next=6;break}_context3.next=3;return this.collectOnePdf(docs);case 3:data=_context3.sent;content=new Blob([data],{type:"application/pdf"});return _context3.abrupt("return",[{content:content,fileName:fileName+".pdf"}]);case 6:if(!(docs.length>1&&this.state.downloadMode==="onezip")){_context3.next=12;break}_context3.next=9;return this.collectOneZip(docs,fileName);case 9:_data=_context3.sent;_content=new Blob([_data],{type:"application/zip"});return _context3.abrupt("return",[{content:_content,fileName:fileName+".zip"}]);case 12:return _context3.abrupt("return",docs.map(function(doc){var content=new Blob([doc.data],{type:doc.contentType});var ext=_this5.state.selectedFormat.split(";")[0].split("/").pop();var appendix=doc.name?"_"+doc.name:"";return{content:content,fileName:fileName+appendix+"."+ext}}));case 13:case"end":return _context3.stop()}},_callee3,this)}));function collectFiles(_x4,_x5){return _collectFiles.apply(this,arguments)}return collectFiles}()},{key:"collectOnePdf",value:function(){var _collectOnePdf=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(docs){var _yield$import,PDFDocument,mergedDoc,_iterator2,_step2,doc,pdfBytes,copiedPages,_iterator3,_step3,page;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return import("pdf-lib");case 2:_yield$import=_context4.sent;PDFDocument=_yield$import.PDFDocument;_context4.next=6;return PDFDocument.create();case 6:mergedDoc=_context4.sent;_iterator2=_createForOfIteratorHelper(docs);_context4.prev=8;_iterator2.s();case 10:if((_step2=_iterator2.n()).done){_context4.next=22;break}doc=_step2.value;_context4.next=14;return PDFDocument.load(doc.data);case 14:pdfBytes=_context4.sent;_context4.next=17;return mergedDoc.copyPages(pdfBytes,pdfBytes.getPageIndices());case 17:copiedPages=_context4.sent;_iterator3=_createForOfIteratorHelper(copiedPages);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){page=_step3.value;mergedDoc.addPage(page)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}case 20:_context4.next=10;break;case 22:_context4.next=27;break;case 24:_context4.prev=24;_context4.t0=_context4["catch"](8);_iterator2.e(_context4.t0);case 27:_context4.prev=27;_iterator2.f();return _context4.finish(27);case 30:_context4.next=32;return mergedDoc.save();case 32:return _context4.abrupt("return",_context4.sent);case 33:case"end":return _context4.stop()}},_callee4,null,[[8,24,27,30]])}));function collectOnePdf(_x6){return _collectOnePdf.apply(this,arguments)}return collectOnePdf}()},{key:"collectOneZip",value:function(){var _collectOneZip=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(docs,fileName){var mergedDoc,_iterator4,_step4,doc,file,ext,appendix;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:mergedDoc=new JSZip;_iterator4=_createForOfIteratorHelper(docs);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){doc=_step4.value;file=new Blob([doc.data],{type:doc.contentType});ext=this.state.selectedFormat.split(";")[0].split("/").pop();appendix=doc.name?"_"+doc.name:"";mergedDoc.file(fileName+appendix+"."+ext,file)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_context5.next=5;return mergedDoc.generateAsync({type:"arraybuffer"});case 5:return _context5.abrupt("return",_context5.sent);case 6:case"end":return _context5.stop()}},_callee5,this)}));function collectOneZip(_x7,_x8){return _collectOneZip.apply(this,arguments)}return collectOneZip}()}])}(React.Component);_defineProperty(Print,"propTypes",{active:PropTypes.bool,addLayerFeatures:PropTypes.func,/** Whether to allow GeoPDF export. Requires QGIS Server 3.32 or newer. */allowGeoPdfExport:PropTypes.bool,clearLayer:PropTypes.func,/** The default print dpi. */defaultDpi:PropTypes.number,/** The factor to apply to the map scale to determine the initial print map scale. */defaultScaleFactor:PropTypes.number,/** Show an option to print a series of extents. */displayPrintSeries:PropTypes.bool,/** Whether to display the printing rotation control. */displayRotation:PropTypes.bool,/** Template for the name of the generated files when downloading. Can contain the placeholders `{layout}`, `{username}`, `{tenant}`, `{theme}`, `{themeTitle}`, `{timestamp}`. */fileNameTemplate:PropTypes.string,/** Export layout format mimetypes. If format is not supported by QGIS Server, print will fail. */formats:PropTypes.arrayOf(PropTypes.string),/** Whether the grid is enabled by default. */gridInitiallyEnabled:PropTypes.bool,/** Whether to hide form fields which contain autopopulated values (i.e. search result label). */hideAutopopulatedFields:PropTypes.bool,/** Whether to display the print output in an inline dialog instead triggering a download. */inlinePrintOutput:PropTypes.bool,layers:PropTypes.array,/** Hide layouts which begin with this prefix. */layoutHidePrefix:PropTypes.string,/** Layout sort order, asc or desc. */layoutSortOrder:PropTypes.string,map:PropTypes.object,/** Whether to allow moving the extent while selecting the print series. */movePrintSeries:PropTypes.bool,/** Whether to print external layers. Requires QGIS Server 3.x! */printExternalLayers:PropTypes.bool,/** Whether to print highlights on the map, e.g. selected features or redlining. */printMapHighlights:PropTypes.bool,/** Scale factor to apply to line widths, font sizes, ... of redlining drawings passed to GetPrint. */scaleFactor:PropTypes.number,setIdentifyEnabled:PropTypes.func,setSnappingConfig:PropTypes.func,/** The side of the application on which to display the sidebar. */side:PropTypes.string,theme:PropTypes.object});_defineProperty(Print,"defaultProps",{defaultDpi:300,defaultScaleFactor:0.5,displayPrintSeries:false,displayRotation:true,fileNameTemplate:"{theme}_{timestamp}",gridInitiallyEnabled:false,layoutSortOrder:"asc",movePrintSeries:false,formats:["application/pdf","image/jpeg","image/png","image/svg"],inlinePrintOutput:false,printExternalLayers:true,printMapHighlights:true,scaleFactor:1.9,// Experimentally determined...
|
|
22
|
+
if(this.props.inlinePrintOutput&&files.length===1){file=files.pop();fileURL=URL.createObjectURL(file.content);this.setState({pdfData:file,pdfDataUrl:fileURL,outputLoaded:true})}else{_iterator=_createForOfIteratorHelper(files);try{for(_iterator.s();!(_step=_iterator.n()).done;){_file=_step.value;FileSaver.saveAs(_file.content,_file.fileName)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}case 8:case"end":return _context.stop()}},_callee,this)}));function batchPrint(_x,_x2){return _batchPrint.apply(this,arguments)}return batchPrint}()},{key:"printRequest",value:function(){var _printRequest=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formData){var data,config,response,contentType;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:data=Object.entries(formData).map(function(pair){return pair.map(function(entry){return encodeURIComponent(entry).replace(/%20/g,"+")}).join("=")}).join("&");config={headers:{"Content-Type":"application/x-www-form-urlencoded"},responseType:"arraybuffer"};_context2.next=4;return axios.post(this.props.theme.printUrl,data,config);case 4:response=_context2.sent;contentType=response.headers["content-type"];return _context2.abrupt("return",{name:formData.name,data:response.data,contentType:contentType});case 7:case"end":return _context2.stop()}},_callee2,this)}));function printRequest(_x3){return _printRequest.apply(this,arguments)}return printRequest}()},{key:"collectFiles",value:function(){var _collectFiles=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(docs,fileName){var _this5=this;var data,content,_data,_content;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(docs.length>1&&this.state.downloadMode==="onepdf")){_context3.next=6;break}_context3.next=3;return this.collectOnePdf(docs);case 3:data=_context3.sent;content=new Blob([data],{type:"application/pdf"});return _context3.abrupt("return",[{content:content,fileName:fileName+".pdf"}]);case 6:if(!(docs.length>1&&this.state.downloadMode==="onezip")){_context3.next=12;break}_context3.next=9;return this.collectOneZip(docs,fileName);case 9:_data=_context3.sent;_content=new Blob([_data],{type:"application/zip"});return _context3.abrupt("return",[{content:_content,fileName:fileName+".zip"}]);case 12:return _context3.abrupt("return",docs.map(function(doc){var content=new Blob([doc.data],{type:doc.contentType});var ext=_this5.state.selectedFormat.split(";")[0].split("/").pop();var appendix=doc.name?"_"+doc.name:"";return{content:content,fileName:fileName+appendix+"."+ext}}));case 13:case"end":return _context3.stop()}},_callee3,this)}));function collectFiles(_x4,_x5){return _collectFiles.apply(this,arguments)}return collectFiles}()},{key:"collectOnePdf",value:function(){var _collectOnePdf=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(docs){var _yield$import,PDFDocument,mergedDoc,_iterator2,_step2,doc,pdfBytes,copiedPages,_iterator3,_step3,page;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return import("pdf-lib");case 2:_yield$import=_context4.sent;PDFDocument=_yield$import.PDFDocument;_context4.next=6;return PDFDocument.create();case 6:mergedDoc=_context4.sent;_iterator2=_createForOfIteratorHelper(docs);_context4.prev=8;_iterator2.s();case 10:if((_step2=_iterator2.n()).done){_context4.next=22;break}doc=_step2.value;_context4.next=14;return PDFDocument.load(doc.data);case 14:pdfBytes=_context4.sent;_context4.next=17;return mergedDoc.copyPages(pdfBytes,pdfBytes.getPageIndices());case 17:copiedPages=_context4.sent;_iterator3=_createForOfIteratorHelper(copiedPages);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){page=_step3.value;mergedDoc.addPage(page)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}case 20:_context4.next=10;break;case 22:_context4.next=27;break;case 24:_context4.prev=24;_context4.t0=_context4["catch"](8);_iterator2.e(_context4.t0);case 27:_context4.prev=27;_iterator2.f();return _context4.finish(27);case 30:_context4.next=32;return mergedDoc.save();case 32:return _context4.abrupt("return",_context4.sent);case 33:case"end":return _context4.stop()}},_callee4,null,[[8,24,27,30]])}));function collectOnePdf(_x6){return _collectOnePdf.apply(this,arguments)}return collectOnePdf}()},{key:"collectOneZip",value:function(){var _collectOneZip=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(docs,fileName){var mergedDoc,_iterator4,_step4,doc,file,ext,appendix;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:mergedDoc=new JSZip;_iterator4=_createForOfIteratorHelper(docs);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){doc=_step4.value;file=new Blob([doc.data],{type:doc.contentType});ext=this.state.selectedFormat.split(";")[0].split("/").pop();appendix=doc.name?"_"+doc.name:"";mergedDoc.file(fileName+appendix+"."+ext,file)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_context5.next=5;return mergedDoc.generateAsync({type:"arraybuffer"});case 5:return _context5.abrupt("return",_context5.sent);case 6:case"end":return _context5.stop()}},_callee5,this)}));function collectOneZip(_x7,_x8){return _collectOneZip.apply(this,arguments)}return collectOneZip}()}])}(React.Component);_defineProperty(Print,"propTypes",{active:PropTypes.bool,addLayerFeatures:PropTypes.func,/** Whether to allow GeoPDF export. Requires QGIS Server 3.32 or newer. */allowGeoPdfExport:PropTypes.bool,clearLayer:PropTypes.func,/** The default print dpi. */defaultDpi:PropTypes.number,/** The factor to apply to the map scale to determine the initial print map scale. */defaultScaleFactor:PropTypes.number,/** Show an option to print a series of extents. */displayPrintSeries:PropTypes.bool,/** Whether to display the printing rotation control. */displayRotation:PropTypes.bool,/** Template for the name of the generated files when downloading. Can contain the placeholders `{layout}`, `{username}`, `{tenant}`, `{theme}`, `{themeTitle}`, `{timestamp}`. */fileNameTemplate:PropTypes.string,/** Export layout format mimetypes. If format is not supported by QGIS Server, print will fail. */formats:PropTypes.arrayOf(PropTypes.string),/** Whether the grid is enabled by default. */gridInitiallyEnabled:PropTypes.bool,/** Whether to hide form fields which contain autopopulated values (i.e. search result label). */hideAutopopulatedFields:PropTypes.bool,/** Whether to display the print output in an inline dialog instead triggering a download. */inlinePrintOutput:PropTypes.bool,layers:PropTypes.array,/** Hide layouts which begin with this prefix. */layoutHidePrefix:PropTypes.string,/** Layout sort order, asc or desc. */layoutSortOrder:PropTypes.string,map:PropTypes.object,/** Whether to allow moving the extent while selecting the print series. */movePrintSeries:PropTypes.bool,/** Whether to print external layers. Requires QGIS Server 3.x! */printExternalLayers:PropTypes.bool,/** Whether to print highlights on the map, e.g. selected features or redlining. */printMapHighlights:PropTypes.bool,/** Restrict print scale to list of predefine print scales, if any. */restrictToPrintScales:PropTypes.bool,/** Scale factor to apply to line widths, font sizes, ... of redlining drawings passed to GetPrint. */scaleFactor:PropTypes.number,setIdentifyEnabled:PropTypes.func,setSnappingConfig:PropTypes.func,/** The side of the application on which to display the sidebar. */side:PropTypes.string,theme:PropTypes.object});_defineProperty(Print,"defaultProps",{defaultDpi:300,defaultScaleFactor:0.5,displayPrintSeries:false,displayRotation:true,fileNameTemplate:"{theme}_{timestamp}",gridInitiallyEnabled:false,layoutSortOrder:"asc",movePrintSeries:false,formats:["application/pdf","image/jpeg","image/png","image/svg"],inlinePrintOutput:false,printExternalLayers:true,printMapHighlights:true,scaleFactor:1.9,// Experimentally determined...
|
|
23
23
|
side:"right"});var selector=function selector(state){return{active:state.task.id==="Print",theme:state.theme.current,map:state.map,layers:state.layers.flat}};export default connect(selector,{addLayerFeatures:addLayerFeatures,clearLayer:clearLayer,setSnappingConfig:setSnappingConfig})(Print);
|
package/plugins/Redlining.js
CHANGED
|
@@ -6,7 +6,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/import React from"react";import{connect}from"react-redux";import FileSaver from"file-saver";import ol from"openlayers";import PropTypes from"prop-types";import{LayerRole,addLayer}from"../actions/layers";import{setSnappingConfig}from"../actions/map";import{changeRedliningState,resetRedliningState}from"../actions/redlining";import Icon from"../components/Icon";import TaskBar from"../components/TaskBar";import ButtonBar from"../components/widgets/ButtonBar";import ColorButton from"../components/widgets/ColorButton";import ComboBox from"../components/widgets/ComboBox";import MenuButton from"../components/widgets/MenuButton";import NumberInput from"../components/widgets/NumberInput";import VectorLayerPicker from"../components/widgets/VectorLayerPicker";import ConfigUtils from"../utils/ConfigUtils";import{END_MARKERS}from"../utils/FeatureStyles";import LocaleUtils from"../utils/LocaleUtils";import MapUtils from"../utils/MapUtils";import VectorLayerUtils from"../utils/VectorLayerUtils";import"./style/Redlining.css";/**
|
|
8
8
|
* Allows drawing figures and text labels on the map.
|
|
9
|
-
*/var Redlining=/*#__PURE__*/function(_React$Component){function Redlining(props){var _this;_classCallCheck(this,Redlining);_this=_callSuper(this,Redlining,[props]);_defineProperty(_this,"state",{selectText:false});_defineProperty(_this,"onShow",function(mode,data){var _data$geomType;_this.props.changeRedliningState(_objectSpread({action:mode!==null&&mode!==void 0?mode:"Pick",geomType:(_data$geomType=data===null||data===void 0?void 0:data.geomType)!==null&&_data$geomType!==void 0?_data$geomType:null},_this.redliningStateDefaults()));_this.props.setSnappingConfig(_this.props.snapping,_this.props.snappingActive);if(data&&data.layerId){var layer=_this.props.layers.find(function(l){return l.id===data.layerId});if(layer){_this.changeRedliningLayer(layer)}}});_defineProperty(_this,"onHide",function(){_this.props.resetRedliningState()});_defineProperty(_this,"redliningStateDefaults",function(){return{style:_objectSpread(_objectSpread({},_this.props.redlining.style),{},{borderColor:_this.props.defaultBorderColor,fillColor:_this.props.defaultFillColor,textOutlineColor:_this.props.defaultTextOutlineColor,textFillColor:_this.props.defaultTextFillColor}),lenUnit:_this.props.defaultLengthUnit,areaUnit:_this.props.defaultAreaUnit}});_defineProperty(_this,"updateRedliningStyle",function(diff){var newStyle=_objectSpread(_objectSpread({},_this.props.redlining.style),diff);_this.props.changeRedliningState({style:newStyle})});_defineProperty(_this,"renderBody",function(){var _this$props$layers$fi;var toolEnabled=function toolEnabled(tool){return!_this.props.hiddenTools.includes(tool)};var activeButton=_this.props.redlining.action==="Draw"?_this.props.redlining.geomType:_this.props.redlining.action;var drawButtons=[{key:"Point",tooltip:LocaleUtils.tr("redlining.point"),icon:"point",data:{action:"Draw",geomType:"Point",text:""}},{key:"LineString",tooltip:LocaleUtils.tr("redlining.line"),icon:"line",data:{action:"Draw",geomType:"LineString",text:""}},{key:"Polygon",tooltip:LocaleUtils.tr("redlining.polygon"),icon:"polygon",data:{action:"Draw",geomType:"Polygon",text:""}},[toolEnabled("Circle")?{key:"Circle",tooltip:LocaleUtils.tr("redlining.circle"),icon:"circle",data:{action:"Draw",geomType:"Circle",text:""}}:null,toolEnabled("Ellipse")?{key:"Ellipse",tooltip:LocaleUtils.tr("redlining.ellipse"),icon:"ellipse",data:{action:"Draw",geomType:"Ellipse",text:""}}:null,toolEnabled("Square")?{key:"Square",tooltip:LocaleUtils.tr("redlining.square"),icon:"box",data:{action:"Draw",geomType:"Square",text:""}}:null,toolEnabled("Box")?{key:"Box",tooltip:LocaleUtils.tr("redlining.rectangle"),icon:"rect",data:{action:"Draw",geomType:"Box",text:""}}:null].filter(Boolean),{key:"Text",tooltip:LocaleUtils.tr("redlining.text"),icon:"text",data:{action:"Draw",geomType:"Text",text:"",measurements:false}}];if(ConfigUtils.isMobile()){drawButtons=[drawButtons.flat()]}var activeFreeHand=_this.props.redlining.freehand?"HandDrawing":null;var freehandButtons=toolEnabled("HandWriting")?[{key:"HandDrawing",tooltip:LocaleUtils.tr("redlining.freehand"),icon:"freehand",data:{action:"Draw",geomType:_this.props.redlining.geomType,text:"",freehand:!_this.props.redlining.freehand},disabled:_this.props.redlining.geomType!=="LineString"&&_this.props.redlining.geomType!=="Polygon"}]:[];var editButtons=[{key:"Pick",tooltip:LocaleUtils.tr("redlining.pick"),icon:"nodetool",data:{action:"Pick",geomType:null,text:""}},toolEnabled("Transform")?{key:"Transform",tooltip:LocaleUtils.tr("redlining.transform"),icon:"transformtool",data:{action:"Transform",geomType:null,text:""}}:null,{key:"Delete",tooltip:LocaleUtils.tr("redlining.delete"),icon:"trash",data:{action:"Delete",geomType:null},disabled:!_this.props.redlining.selectedFeature}].filter(Boolean);var extraButtons=toolEnabled("NumericInput")?[{key:"NumericInput",tooltip:LocaleUtils.tr("redlining.numericinput"),icon:"numericinput"}]:[];for(var _i=0,_Object$values=Object.values(_this.props.plugins||{});_i<_Object$values.length;_i++){var plugin=_Object$values[_i];if(toolEnabled(plugin.cfg.key)){editButtons.push(_objectSpread(_objectSpread({},plugin.cfg),{},{tooltip:plugin.cfg.tooltip?LocaleUtils.tr(plugin.cfg.tooltip):undefined}))}}var vectorLayers=_this.props.layers.filter(function(layer){return layer.type==="vector"&&layer.role===LayerRole.USERLAYER&&!layer.readonly});// Ensure list always contains at least a "Redlining" layer
|
|
9
|
+
*/var Redlining=/*#__PURE__*/function(_React$Component){function Redlining(props){var _this;_classCallCheck(this,Redlining);_this=_callSuper(this,Redlining,[props]);_defineProperty(_this,"state",{selectText:false});_defineProperty(_this,"onShow",function(mode,data){var _data$geomType;_this.props.changeRedliningState(_objectSpread({action:mode!==null&&mode!==void 0?mode:"Pick",geomType:(_data$geomType=data===null||data===void 0?void 0:data.geomType)!==null&&_data$geomType!==void 0?_data$geomType:null},_this.redliningStateDefaults()));_this.props.setSnappingConfig(_this.props.snapping,_this.props.snappingActive);if(data&&data.layerId){var layer=_this.props.layers.find(function(l){return l.id===data.layerId});if(layer){_this.changeRedliningLayer(layer)}}});_defineProperty(_this,"onHide",function(){_this.props.resetRedliningState()});_defineProperty(_this,"redliningStateDefaults",function(){return{style:_objectSpread(_objectSpread({},_this.props.redlining.style),{},{borderColor:_this.props.defaultBorderColor,fillColor:_this.props.defaultFillColor,textOutlineColor:_this.props.defaultTextOutlineColor,textFillColor:_this.props.defaultTextFillColor}),lenUnit:_this.props.defaultLengthUnit,areaUnit:_this.props.defaultAreaUnit}});_defineProperty(_this,"generateDashIcons",function(){_this.dashIcons=_this.props.predefinedDashPatterns.reduce(function(res,pattern){var svg="<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"16\"><line x1=\"0\" y1=\"8\" x2=\"32\" y2=\"8\" stroke=\"black\" stroke-width=\"2\" stroke-dasharray=\"".concat(pattern.join(" "),"\"></line></svg>");res[pattern.join(":")]="data:image/svg+xml;base64,".concat(btoa(svg));return res},{})});_defineProperty(_this,"updateRedliningStyle",function(diff){var newStyle=_objectSpread(_objectSpread({},_this.props.redlining.style),diff);_this.props.changeRedliningState({style:newStyle})});_defineProperty(_this,"renderBody",function(){var _this$props$layers$fi;var toolEnabled=function toolEnabled(tool){return!_this.props.hiddenTools.includes(tool)};var activeButton=_this.props.redlining.action==="Draw"?_this.props.redlining.geomType:_this.props.redlining.action;var drawButtons=[{key:"Point",tooltip:LocaleUtils.tr("redlining.point"),icon:"point",data:{action:"Draw",geomType:"Point",text:""}},{key:"LineString",tooltip:LocaleUtils.tr("redlining.line"),icon:"line",data:{action:"Draw",geomType:"LineString",text:""}},{key:"Polygon",tooltip:LocaleUtils.tr("redlining.polygon"),icon:"polygon",data:{action:"Draw",geomType:"Polygon",text:""}},[toolEnabled("Circle")?{key:"Circle",tooltip:LocaleUtils.tr("redlining.circle"),icon:"circle",data:{action:"Draw",geomType:"Circle",text:""}}:null,toolEnabled("Ellipse")?{key:"Ellipse",tooltip:LocaleUtils.tr("redlining.ellipse"),icon:"ellipse",data:{action:"Draw",geomType:"Ellipse",text:""}}:null,toolEnabled("Square")?{key:"Square",tooltip:LocaleUtils.tr("redlining.square"),icon:"box",data:{action:"Draw",geomType:"Square",text:""}}:null,toolEnabled("Box")?{key:"Box",tooltip:LocaleUtils.tr("redlining.rectangle"),icon:"rect",data:{action:"Draw",geomType:"Box",text:""}}:null].filter(Boolean),{key:"Text",tooltip:LocaleUtils.tr("redlining.text"),icon:"text",data:{action:"Draw",geomType:"Text",text:"",measurements:false}}];if(ConfigUtils.isMobile()){drawButtons=[drawButtons.flat()]}var activeFreeHand=_this.props.redlining.freehand?"HandDrawing":null;var freehandButtons=toolEnabled("HandWriting")?[{key:"HandDrawing",tooltip:LocaleUtils.tr("redlining.freehand"),icon:"freehand",data:{action:"Draw",geomType:_this.props.redlining.geomType,text:"",freehand:!_this.props.redlining.freehand},disabled:_this.props.redlining.geomType!=="LineString"&&_this.props.redlining.geomType!=="Polygon"}]:[];var editButtons=[{key:"Pick",tooltip:LocaleUtils.tr("redlining.pick"),icon:"nodetool",data:{action:"Pick",geomType:null,text:""}},toolEnabled("Transform")?{key:"Transform",tooltip:LocaleUtils.tr("redlining.transform"),icon:"transformtool",data:{action:"Transform",geomType:null,text:""}}:null,{key:"Delete",tooltip:LocaleUtils.tr("redlining.delete"),icon:"trash",data:{action:"Delete",geomType:null},disabled:!_this.props.redlining.selectedFeature}].filter(Boolean);var extraButtons=toolEnabled("NumericInput")?[{key:"NumericInput",tooltip:LocaleUtils.tr("redlining.numericinput"),icon:"numericinput"}]:[];for(var _i=0,_Object$values=Object.values(_this.props.plugins||{});_i<_Object$values.length;_i++){var plugin=_Object$values[_i];if(toolEnabled(plugin.cfg.key)){editButtons.push(_objectSpread(_objectSpread({},plugin.cfg),{},{tooltip:plugin.cfg.tooltip?LocaleUtils.tr(plugin.cfg.tooltip):undefined}))}}var vectorLayers=_this.props.layers.filter(function(layer){return layer.type==="vector"&&layer.role===LayerRole.USERLAYER&&!layer.readonly});// Ensure list always contains at least a "Redlining" layer
|
|
10
10
|
if(vectorLayers.length===0){vectorLayers=[{id:"redlining",title:LocaleUtils.tr("redlining.layertitle")}].concat(_toConsumableArray(vectorLayers))}var haveLayer=(((_this$props$layers$fi=_this.props.layers.find(function(l){return l.id===_this.props.redlining.layer}))===null||_this$props$layers$fi===void 0||(_this$props$layers$fi=_this$props$layers$fi.features)===null||_this$props$layers$fi===void 0?void 0:_this$props$layers$fi.length)||0)>0;var activePlugin=Object.values(_this.props.plugins||{}).find(function(plugin){return plugin.cfg.key===_this.props.redlining.action});var controls=activePlugin?/*#__PURE__*/React.createElement(activePlugin.controls,null):_this.renderStandardControls();return/*#__PURE__*/React.createElement("div",null,/*#__PURE__*/React.createElement("div",{className:"redlining-controlsbar"},/*#__PURE__*/React.createElement("div",{className:"redlining-groupcontrol"},/*#__PURE__*/React.createElement("div",null,LocaleUtils.tr("redlining.layer")),/*#__PURE__*/React.createElement(VectorLayerPicker,{addLayer:_this.props.addLayer,layers:vectorLayers,onChange:_this.changeRedliningLayer,value:_this.props.redlining.layer})),/*#__PURE__*/React.createElement("div",{className:"redlining-groupcontrol"},/*#__PURE__*/React.createElement("div",null,LocaleUtils.tr("redlining.draw")),/*#__PURE__*/React.createElement("div",{className:"controlgroup"},/*#__PURE__*/React.createElement(ButtonBar,{active:activeButton,buttons:drawButtons,onClick:function onClick(key,data){return _this.actionChanged(data)}}),_this.props.redlining.action==="Draw"&&(_this.props.redlining.geomType==="LineString"||_this.props.redlining.geomType==="Polygon")?/*#__PURE__*/React.createElement(ButtonBar,{active:activeFreeHand,buttons:freehandButtons,onClick:function onClick(key,data){return _this.actionChanged(data)}}):null)),/*#__PURE__*/React.createElement("div",{className:"redlining-groupcontrol"},/*#__PURE__*/React.createElement("div",null,LocaleUtils.tr("redlining.edit")),/*#__PURE__*/React.createElement(ButtonBar,{active:activeButton,buttons:editButtons,onClick:function onClick(key,data){return _this.actionChanged(data)}})),/*#__PURE__*/React.createElement("div",{className:"redlining-groupcontrol"},/*#__PURE__*/React.createElement("div",null,"\xA0"),/*#__PURE__*/React.createElement(ButtonBar,{active:_this.props.redlining.numericInput?"NumericInput":null,buttons:extraButtons,onClick:function onClick(){return _this.props.changeRedliningState({numericInput:!_this.props.redlining.numericInput})}})),toolEnabled("Export")?/*#__PURE__*/React.createElement("div",{className:"redlining-groupcontrol"},/*#__PURE__*/React.createElement("div",null,"\xA0"),/*#__PURE__*/React.createElement(MenuButton,{className:"redlining-export-menu",disabled:!haveLayer,menuIcon:"export",onActivate:_this["export"],tooltip:LocaleUtils.tr("redlining.export")},/*#__PURE__*/React.createElement("div",{className:"redlining-export-menu-entry",key:"GeoJSON",value:"geojson"},"GeoJSON"),/*#__PURE__*/React.createElement("div",{className:"redlining-export-menu-entry",key:"KML",value:"kml"},"KML"))):null),controls)});_defineProperty(_this,"export",function(type){if(type==="geojson"){var layer=_this.props.layers.find(function(l){return l.id===_this.props.redlining.layer});if(!layer){return}var geojson=JSON.stringify({type:"FeatureCollection",features:layer.features.map(function(feature){var newFeature=_objectSpread(_objectSpread({},feature),{},{geometry:VectorLayerUtils.reprojectGeometry(feature.geometry,feature.crs||_this.props.mapCrs,"EPSG:4326")});delete newFeature.crs;return newFeature})},null," ");FileSaver.saveAs(new Blob([geojson],{type:"text/plain;charset=utf-8"}),layer.title+".json")}else if(type==="kml"){var getNativeLayer=MapUtils.getHook(MapUtils.GET_NATIVE_LAYER);var _layer=_this.props.layers.find(function(l){return l.id===_this.props.redlining.layer});var nativeLayer=getNativeLayer(_this.props.redlining.layer);if(!nativeLayer){return}var kmlFormat=new ol.format.KML;var features=nativeLayer.getSource().getFeatures().map(function(feature){// Circle is not supported by kml format
|
|
11
|
-
if(feature.getGeometry()instanceof ol.geom.Circle){feature=feature.clone();feature.setGeometry(ol.geom.polygonFromCircle(feature.getGeometry()))}return feature});var data=kmlFormat.writeFeatures(features,{featureProjection:_this.props.mapCrs});FileSaver.saveAs(new Blob([data],{type:"application/vnd.google-earth.kml+xml"}),_layer.title+".kml")}});_defineProperty(_this,"renderStandardControls",function(){var sizeLabel=LocaleUtils.tr("redlining.size");if(_this.props.redlining.geomType==="LineString"){sizeLabel=LocaleUtils.tr("redlining.width")}else if(_this.props.redlining.geomType==="Polygon"){sizeLabel=LocaleUtils.tr("redlining.border")}var labelPlaceholder=LocaleUtils.tr("redlining.label");if(_this.props.redlining.geomType==="Text"){labelPlaceholder=LocaleUtils.tr("redlining.text")}if(_this.props.redlining.action!=="Draw"&&!_this.props.redlining.selectedFeature){return null}return/*#__PURE__*/React.createElement("div",{className:"redlining-controlsbar"},/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement(Icon,{className:"redlining-control-icon",icon:"pen",size:"large"}),_this.props.redlining.geomType==="Text"?/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.textOutlineColor,defaultColors:_this.props.predefinedBorderColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({textOutlineColor:color})}}):/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.borderColor,defaultColors:_this.props.predefinedBorderColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({borderColor:color})}})),_this.props.redlining.geomType==="LineString"?null:/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement(Icon,{className:"redlining-control-icon",icon:"fill",size:"large"}),_this.props.redlining.geomType==="Text"?/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.textFillColor,defaultColors:_this.props.predefinedFillColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({textFillColor:color})}}):/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.fillColor,defaultColors:_this.props.predefinedFillColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({fillColor:color})}})),/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement("span",null,sizeLabel,":\xA0"),/*#__PURE__*/React.createElement(NumberInput,{max:99,min:1,mobile:true,onChange:function onChange(nr){return _this.updateRedliningStyle({size:nr})},value:_this.props.redlining.style.size})),_this.props.redlining.geomType==="LineString"?/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("redlining.markers"),":\xA0"),/*#__PURE__*/React.createElement("div",{className:"controlgroup"},/*#__PURE__*/React.createElement(ComboBox,{className:"redlining-marker-combo",onChange:function onChange(value){return _this.updateRedliningStyle({headmarker:value})},value:_this.props.redlining.style.headmarker||""},/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",value:""}),Object.entries(END_MARKERS).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],params=_ref2[1];return/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",key:key,value:key},/*#__PURE__*/React.createElement("img",{src:params.src,style:{transform:"rotate("+params.baserotation+"deg)"}}))})),/*#__PURE__*/React.createElement(ComboBox,{className:"redlining-marker-combo",onChange:function onChange(value){return _this.updateRedliningStyle({tailmarker:value})},value:_this.props.redlining.style.tailmarker||""},/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",value:""}),Object.entries(END_MARKERS).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),key=_ref4[0],params=_ref4[1];return/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",key:key,value:key},/*#__PURE__*/React.createElement("img",{src:params.src,style:{transform:"rotate("+(180+params.baserotation)+"deg)"}}))})))):null,/*#__PURE__*/React.createElement("div",{className:"redlining-control redlining-control-fill"},/*#__PURE__*/React.createElement("div",{className:"controlgroup"},_this.props.redlining.geomType!=="Text"&&_this.props.allowGeometryLabels?/*#__PURE__*/React.createElement("button",{className:"button"+(_this.props.redlining.measurements?" pressed":""),onClick:function onClick(){return _this.props.changeRedliningState({measurements:!_this.props.redlining.measurements,style:_objectSpread(_objectSpread({},_this.props.redlining.style),{},{text:""})})},title:LocaleUtils.tr("redlining.measurements")},/*#__PURE__*/React.createElement(Icon,{icon:"measure"})):null,(_this.props.redlining.geomType==="Text"||_this.props.allowGeometryLabels)&&!_this.props.redlining.measurements?/*#__PURE__*/React.createElement("input",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.updateRedliningStyle({text:ev.target.value})},placeholder:labelPlaceholder,readOnly:_this.props.redlining.measurements,ref:function ref(el){return _this.setLabelRef(el)},type:"text",value:_this.props.redlining.style.text}):null,_this.props.redlining.measurements&&["LineString","Circle"].includes(_this.props.redlining.geomType)?/*#__PURE__*/React.createElement("select",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.props.changeRedliningState({lenUnit:ev.target.value})},value:_this.props.redlining.lenUnit},/*#__PURE__*/React.createElement("option",{value:"metric"},LocaleUtils.tr("measureComponent.metric")),/*#__PURE__*/React.createElement("option",{value:"imperial"},LocaleUtils.tr("measureComponent.imperial")),/*#__PURE__*/React.createElement("option",{value:"m"},"m"),/*#__PURE__*/React.createElement("option",{value:"km"},"km"),/*#__PURE__*/React.createElement("option",{value:"ft"},"ft"),/*#__PURE__*/React.createElement("option",{value:"mi"},"mi")):null,_this.props.redlining.measurements&&["Polygon","Ellipse","Square","Box"].includes(_this.props.redlining.geomType)?/*#__PURE__*/React.createElement("select",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.props.changeRedliningState({areaUnit:ev.target.value})},value:_this.props.redlining.areaUnit},/*#__PURE__*/React.createElement("option",{value:"metric"},LocaleUtils.tr("measureComponent.metric")),/*#__PURE__*/React.createElement("option",{value:"imperial"},LocaleUtils.tr("measureComponent.imperial")),/*#__PURE__*/React.createElement("option",{value:"sqm"},"m\xB2"),/*#__PURE__*/React.createElement("option",{value:"ha"},"ha"),/*#__PURE__*/React.createElement("option",{value:"sqkm"},"km\xB2"),/*#__PURE__*/React.createElement("option",{value:"sqft"},"ft\xB2"),/*#__PURE__*/React.createElement("option",{value:"acre"},"acre"),/*#__PURE__*/React.createElement("option",{value:"sqmi"},"mi\xB2")):null)))});_defineProperty(_this,"setLabelRef",function(el){_this.labelInput=el;if(el&&_this.state.selectText){el.focus();el.select();_this.setState({selectText:false})}});_defineProperty(_this,"actionChanged",function(data){if(data.action==="Draw"&&data.geomType==="Text"){data=_objectSpread(_objectSpread({},data),{},{style:{text:LocaleUtils.tr("redlining.text")}})}else if(!_this.props.allowGeometryLabels){data=_objectSpread(_objectSpread({},data),{},{style:{text:""}})}_this.props.changeRedliningState(data)});_defineProperty(_this,"changeRedliningLayer",function(layer){var action=["Draw","Pick","Transform"].includes(_this.props.redlining.action)?_this.props.redlining.action:"Pick";_this.props.changeRedliningState({layer:layer.id,layerTitle:layer.title,action:action})});_this.labelInput=null;return _this}_inherits(Redlining,_React$Component);return _createClass(Redlining,[{key:"componentDidMount",value:function componentDidMount(){this.componentDidUpdate({redlining:{}})}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this2=this;if(this.props.defaultBorderColor!==prevProps.defaultBorderColor||this.props.defaultFillColor!==prevProps.defaultFillColor||this.props.defaultLengthUnit!==prevProps.defaultLengthUnit||this.props.defaultAreaUnit!==prevProps.defaultAreaUnit||this.props.defaultTextFillColor!==prevProps.defaultTextFillColor||this.props.defaultTextOutlineColor!==prevProps.defaultTextOutlineColor){this.props.changeRedliningState(this.redliningStateDefaults())}if(prevProps.redlining.geomType!==this.props.redlining.geomType&&this.props.redlining.geomType==="Text"&&!this.state.selectText){this.setState({selectText:true})}if(!this.props.layers.find(function(layer){return layer.id===_this2.props.redlining.layer})){var vectorLayers=this.props.layers.filter(function(layer){return layer.type==="vector"&&layer.role===LayerRole.USERLAYER&&!layer.readonly});if(vectorLayers.length>=1){this.props.changeRedliningState({layer:vectorLayers[0].id,layerTitle:vectorLayers[0].title})}else if(this.props.redlining.layer!=="redlining"){this.props.changeRedliningState({layer:"redlining",layerTitle:LocaleUtils.tr("redlining.layertitle")})}}}},{key:"render",value:function render(){var _this3=this;return/*#__PURE__*/React.createElement(TaskBar,{onHide:this.onHide,onShow:this.onShow,task:"Redlining"},function(){return{body:_this3.renderBody()}})}}])}(React.Component);_defineProperty(Redlining,"propTypes",{addLayer:PropTypes.func,/** Whether to allow labeling geometric figures. */allowGeometryLabels:PropTypes.bool,changeRedliningState:PropTypes.func,/** Default area unit. Options: metric, imperial, sqm, ha, sqkm, sqft, acre, sqmi */defaultAreaUnit:PropTypes.string,/** Default border color. In format [r, g, b, a]. */defaultBorderColor:PropTypes.array,/** Default fill color. In format [r, g, b, a]. */defaultFillColor:PropTypes.array,/** Default length unit. Options: metric, imperial, m, km, ft, mi */defaultLengthUnit:PropTypes.string,/** Default text fill color. In format [r, g, b, a]. */defaultTextFillColor:PropTypes.array,/** Default text outline color. In format [r, g, b, a]. */defaultTextOutlineColor:PropTypes.array,/** Tools to hide. Available tools: Circle, Ellipse, Square, Box, HandDrawing, Transform, NumericInput, Buffer, Export. */hiddenTools:PropTypes.array,layers:PropTypes.array,mapCrs:PropTypes.string,plugins:PropTypes.object,/** Predefined border colors. In format [[r, g, b, a], ...]. */predefinedBorderColors:PropTypes.arrayOf(PropTypes.array),/** Predefined fill colors. In format [[r, g, b, a], ...]. */predefinedFillColors:PropTypes.arrayOf(PropTypes.array),redlining:PropTypes.object,resetRedliningState:PropTypes.func,setCurrentTask:PropTypes.func,setSnappingConfig:PropTypes.func,/** Whether snapping is available when editing. */snapping:PropTypes.bool,/** Whether snapping is enabled by default when editing.
|
|
12
|
-
* Either `false`, `edge`, `vertex` or `true` (i.e. both vertex and edge). */snappingActive:PropTypes.oneOfType([PropTypes.bool,PropTypes.string])});_defineProperty(Redlining,"defaultProps",{allowGeometryLabels:true,hiddenTools:[],snapping:true,snappingActive:true,plugins:[],defaultBorderColor:[255,0,0,1],defaultFillColor:[255,255,255,1],defaultTextFillColor:[0,0,0,1],defaultTextOutlineColor:[255,255,255,1],defaultAreaUnit:"metric",defaultLengthUnit:"metric"});export default(function(plugins){return connect(function(state){return{layers:state.layers.flat,redlining:state.redlining,mapCrs:state.map.projection,plugins:plugins}},{changeRedliningState:changeRedliningState,addLayer:addLayer,resetRedliningState:resetRedliningState,setSnappingConfig:setSnappingConfig})(Redlining)});
|
|
11
|
+
if(feature.getGeometry()instanceof ol.geom.Circle){feature=feature.clone();feature.setGeometry(ol.geom.polygonFromCircle(feature.getGeometry()))}return feature});var data=kmlFormat.writeFeatures(features,{featureProjection:_this.props.mapCrs});FileSaver.saveAs(new Blob([data],{type:"application/vnd.google-earth.kml+xml"}),_layer.title+".kml")}});_defineProperty(_this,"renderStandardControls",function(){var sizeLabel=LocaleUtils.tr("redlining.line");var showDash=true;if(["Text","Point"].includes(_this.props.redlining.geomType)){sizeLabel=LocaleUtils.tr("redlining.size");showDash=false}var labelPlaceholder=LocaleUtils.tr("redlining.label");if(_this.props.redlining.geomType==="Text"){labelPlaceholder=LocaleUtils.tr("redlining.text")}if(_this.props.redlining.action!=="Draw"&&!_this.props.redlining.selectedFeature){return null}return/*#__PURE__*/React.createElement("div",{className:"redlining-controlsbar"},/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement(Icon,{className:"redlining-control-icon",icon:"pen",size:"large"}),_this.props.redlining.geomType==="Text"?/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.textOutlineColor,defaultColors:_this.props.predefinedBorderColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({textOutlineColor:color})}}):/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.borderColor,defaultColors:_this.props.predefinedBorderColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({borderColor:color})}})),_this.props.redlining.geomType==="LineString"?null:/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement(Icon,{className:"redlining-control-icon",icon:"fill",size:"large"}),_this.props.redlining.geomType==="Text"?/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.textFillColor,defaultColors:_this.props.predefinedFillColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({textFillColor:color})}}):/*#__PURE__*/React.createElement(ColorButton,{color:_this.props.redlining.style.fillColor,defaultColors:_this.props.predefinedFillColors,onColorChanged:function onColorChanged(color){return _this.updateRedliningStyle({fillColor:color})}})),/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement("span",null,sizeLabel,":\xA0"),/*#__PURE__*/React.createElement(NumberInput,{max:99,min:1,mobile:true,onChange:function onChange(nr){return _this.updateRedliningStyle({size:nr})},value:_this.props.redlining.style.size}),showDash?/*#__PURE__*/React.createElement(ComboBox,{onChange:function onChange(value){return _this.updateRedliningStyle({strokeDash:value.split(":").filter(Boolean).map(Number)})},value:_this.props.redlining.style.strokeDash.join(":")},_this.props.predefinedDashPatterns.map(function(pattern){var value=pattern.join(":");return/*#__PURE__*/React.createElement("div",{className:"redlining-dash-combo-entry",key:value,value:value},/*#__PURE__*/React.createElement("img",{src:_this.dashIcons[value]}))})):null),_this.props.redlining.geomType==="LineString"?/*#__PURE__*/React.createElement("div",{className:"redlining-control"},/*#__PURE__*/React.createElement("span",null,LocaleUtils.tr("redlining.markers"),":\xA0"),/*#__PURE__*/React.createElement("div",{className:"controlgroup"},/*#__PURE__*/React.createElement(ComboBox,{className:"redlining-marker-combo",onChange:function onChange(value){return _this.updateRedliningStyle({headmarker:value})},value:_this.props.redlining.style.headmarker||""},/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",value:""}),Object.entries(END_MARKERS).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],params=_ref2[1];return/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",key:key,value:key},/*#__PURE__*/React.createElement("img",{src:params.src,style:{transform:"rotate("+params.baserotation+"deg)"}}))})),/*#__PURE__*/React.createElement(ComboBox,{className:"redlining-marker-combo",onChange:function onChange(value){return _this.updateRedliningStyle({tailmarker:value})},value:_this.props.redlining.style.tailmarker||""},/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",value:""}),Object.entries(END_MARKERS).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),key=_ref4[0],params=_ref4[1];return/*#__PURE__*/React.createElement("div",{className:"redlining-marker-combo-entry",key:key,value:key},/*#__PURE__*/React.createElement("img",{src:params.src,style:{transform:"rotate("+(180+params.baserotation)+"deg)"}}))})))):null,/*#__PURE__*/React.createElement("div",{className:"redlining-control redlining-control-fill"},/*#__PURE__*/React.createElement("div",{className:"controlgroup"},_this.props.redlining.geomType!=="Text"&&_this.props.allowGeometryLabels?/*#__PURE__*/React.createElement("button",{className:"button"+(_this.props.redlining.measurements?" pressed":""),onClick:function onClick(){return _this.props.changeRedliningState({measurements:!_this.props.redlining.measurements,style:_objectSpread(_objectSpread({},_this.props.redlining.style),{},{text:""})})},title:LocaleUtils.tr("redlining.measurements")},/*#__PURE__*/React.createElement(Icon,{icon:"measure"})):null,(_this.props.redlining.geomType==="Text"||_this.props.allowGeometryLabels)&&!_this.props.redlining.measurements?/*#__PURE__*/React.createElement("input",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.updateRedliningStyle({text:ev.target.value})},placeholder:labelPlaceholder,readOnly:_this.props.redlining.measurements,ref:function ref(el){return _this.setLabelRef(el)},type:"text",value:_this.props.redlining.style.text}):null,_this.props.redlining.measurements&&["LineString","Circle"].includes(_this.props.redlining.geomType)?/*#__PURE__*/React.createElement("select",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.props.changeRedliningState({lenUnit:ev.target.value})},value:_this.props.redlining.lenUnit},/*#__PURE__*/React.createElement("option",{value:"metric"},LocaleUtils.tr("measureComponent.metric")),/*#__PURE__*/React.createElement("option",{value:"imperial"},LocaleUtils.tr("measureComponent.imperial")),/*#__PURE__*/React.createElement("option",{value:"m"},"m"),/*#__PURE__*/React.createElement("option",{value:"km"},"km"),/*#__PURE__*/React.createElement("option",{value:"ft"},"ft"),/*#__PURE__*/React.createElement("option",{value:"mi"},"mi")):null,_this.props.redlining.measurements&&["Polygon","Ellipse","Square","Box"].includes(_this.props.redlining.geomType)?/*#__PURE__*/React.createElement("select",{className:"controlgroup-fillitem",onChange:function onChange(ev){return _this.props.changeRedliningState({areaUnit:ev.target.value})},value:_this.props.redlining.areaUnit},/*#__PURE__*/React.createElement("option",{value:"metric"},LocaleUtils.tr("measureComponent.metric")),/*#__PURE__*/React.createElement("option",{value:"imperial"},LocaleUtils.tr("measureComponent.imperial")),/*#__PURE__*/React.createElement("option",{value:"sqm"},"m\xB2"),/*#__PURE__*/React.createElement("option",{value:"ha"},"ha"),/*#__PURE__*/React.createElement("option",{value:"sqkm"},"km\xB2"),/*#__PURE__*/React.createElement("option",{value:"sqft"},"ft\xB2"),/*#__PURE__*/React.createElement("option",{value:"acre"},"acre"),/*#__PURE__*/React.createElement("option",{value:"sqmi"},"mi\xB2")):null)))});_defineProperty(_this,"setLabelRef",function(el){_this.labelInput=el;if(el&&_this.state.selectText){el.focus();el.select();_this.setState({selectText:false})}});_defineProperty(_this,"actionChanged",function(data){if(data.action==="Draw"&&data.geomType==="Text"){data=_objectSpread(_objectSpread({},data),{},{style:{text:LocaleUtils.tr("redlining.text")}})}else if(!_this.props.allowGeometryLabels){data=_objectSpread(_objectSpread({},data),{},{style:{text:""}})}_this.props.changeRedliningState(data)});_defineProperty(_this,"changeRedliningLayer",function(layer){var action=["Draw","Pick","Transform"].includes(_this.props.redlining.action)?_this.props.redlining.action:"Pick";_this.props.changeRedliningState({layer:layer.id,layerTitle:layer.title,action:action})});_this.labelInput=null;_this.dashIcons={};return _this}_inherits(Redlining,_React$Component);return _createClass(Redlining,[{key:"componentDidMount",value:function componentDidMount(){this.componentDidUpdate({redlining:{}})}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this2=this;if(this.props.defaultBorderColor!==prevProps.defaultBorderColor||this.props.defaultFillColor!==prevProps.defaultFillColor||this.props.defaultLengthUnit!==prevProps.defaultLengthUnit||this.props.defaultAreaUnit!==prevProps.defaultAreaUnit||this.props.defaultTextFillColor!==prevProps.defaultTextFillColor||this.props.defaultTextOutlineColor!==prevProps.defaultTextOutlineColor){this.props.changeRedliningState(this.redliningStateDefaults())}if(prevProps.redlining.geomType!==this.props.redlining.geomType&&this.props.redlining.geomType==="Text"&&!this.state.selectText){this.setState({selectText:true})}if(!this.props.layers.find(function(layer){return layer.id===_this2.props.redlining.layer})){var vectorLayers=this.props.layers.filter(function(layer){return layer.type==="vector"&&layer.role===LayerRole.USERLAYER&&!layer.readonly});if(vectorLayers.length>=1){this.props.changeRedliningState({layer:vectorLayers[0].id,layerTitle:vectorLayers[0].title})}else if(this.props.redlining.layer!=="redlining"){this.props.changeRedliningState({layer:"redlining",layerTitle:LocaleUtils.tr("redlining.layertitle")})}}if(this.props.predefinedDashPatterns!==prevProps.predefinedDashPatterns){this.generateDashIcons()}}},{key:"render",value:function render(){var _this3=this;return/*#__PURE__*/React.createElement(TaskBar,{onHide:this.onHide,onShow:this.onShow,task:"Redlining"},function(){return{body:_this3.renderBody()}})}}])}(React.Component);_defineProperty(Redlining,"propTypes",{addLayer:PropTypes.func,/** Whether to allow labeling geometric figures. */allowGeometryLabels:PropTypes.bool,changeRedliningState:PropTypes.func,/** Default area unit. Options: `metric`, `imperial`, `sqm`, `ha`, `sqkm`, `sqft`, `acre`, `sqmi` */defaultAreaUnit:PropTypes.string,/** Default border color. In format `[r, g, b, a]`. */defaultBorderColor:PropTypes.array,/** Default fill color. In format `[r, g, b, a]`. */defaultFillColor:PropTypes.array,/** Default length unit. Options: `metric`, `imperial`, `m`, `km`, `ft`, `mi` */defaultLengthUnit:PropTypes.string,/** Default text fill color. In format `[r, g, b, a]`. */defaultTextFillColor:PropTypes.array,/** Default text outline color. In format `[r, g, b, a]`. */defaultTextOutlineColor:PropTypes.array,/** Tools to hide. Available tools: `Circle`, `Ellipse`, `Square`, `Box`, `HandDrawing`, `Transform`, `NumericInput`, `Buffer`, `Export`. */hiddenTools:PropTypes.array,layers:PropTypes.array,mapCrs:PropTypes.string,plugins:PropTypes.object,/** Predefined border colors. In format `[[r, g, b, a], ...]`. */predefinedBorderColors:PropTypes.arrayOf(PropTypes.array),/** Predefined dash patterns. In format `[<dash-array>, ...]`, where a dash-array is list of alternating dash and gap widths, i.e. `[8 4]` for long dashes followed by shorter gaps. */predefinedDashPatterns:PropTypes.arrayOf(PropTypes.array),/** Predefined fill colors. In format `[[r, g, b, a], ...]`. */predefinedFillColors:PropTypes.arrayOf(PropTypes.array),redlining:PropTypes.object,resetRedliningState:PropTypes.func,setCurrentTask:PropTypes.func,setSnappingConfig:PropTypes.func,/** Whether snapping is available when editing. */snapping:PropTypes.bool,/** Whether snapping is enabled by default when editing.
|
|
12
|
+
* Either `false`, `edge`, `vertex` or `true` (i.e. both vertex and edge). */snappingActive:PropTypes.oneOfType([PropTypes.bool,PropTypes.string])});_defineProperty(Redlining,"defaultProps",{allowGeometryLabels:true,hiddenTools:[],snapping:true,snappingActive:true,plugins:[],defaultBorderColor:[255,0,0,1],defaultFillColor:[255,255,255,1],defaultTextFillColor:[0,0,0,1],defaultTextOutlineColor:[255,255,255,1],defaultAreaUnit:"metric",defaultLengthUnit:"metric",predefinedDashPatterns:[[],[8,8],[1,8],[8,8,1,8]]});export default(function(plugins){return connect(function(state){return{layers:state.layers.flat,redlining:state.redlining,mapCrs:state.map.projection,plugins:plugins}},{changeRedliningState:changeRedliningState,addLayer:addLayer,resetRedliningState:resetRedliningState,setSnappingConfig:setSnappingConfig})(Redlining)});
|
package/plugins/TopBar.js
CHANGED
|
@@ -4,10 +4,10 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/import React from"react";import{connect}from"react-redux";import classnames from"classnames";import PropTypes from"prop-types";import{toggleFullscreen}from"../actions/display";import{openExternalUrl,setTopbarHeight}from"../actions/windows";import{Swipeable}from"../components/Swipeable";import ConfigUtils from"../utils/ConfigUtils";import LocaleUtils from"../utils/LocaleUtils";import ThemeUtils from"../utils/ThemeUtils";import"./style/TopBar.css";/**
|
|
7
|
+
*/import React from"react";import{connect}from"react-redux";import classnames from"classnames";import{remove as removeDiacritics}from"diacritics";import PropTypes from"prop-types";import{toggleFullscreen}from"../actions/display";import{openExternalUrl,setTopbarHeight}from"../actions/windows";import{Swipeable}from"../components/Swipeable";import ConfigUtils from"../utils/ConfigUtils";import LocaleUtils from"../utils/LocaleUtils";import{registerSearchProvider,SearchResultType,unregisterSearchProvider}from"../utils/SearchProviders";import ThemeUtils from"../utils/ThemeUtils";import"./style/TopBar.css";/**
|
|
8
8
|
* Top bar, containing the logo, searchbar, task buttons and app menu.
|
|
9
|
-
*/var TopBar=/*#__PURE__*/function(_React$Component){function TopBar(){var _this;_classCallCheck(this,TopBar);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,TopBar,[].concat(args));_defineProperty(_this,"state",{allowedMenuItems:[],allowedToolbarItems:[]});_defineProperty(_this,"openUrl",function(url,target,title,icon){if(target==="iframe"){target=":iframedialog:externallinkiframe"}_this.props.openExternalUrl(url,target,{title:title,icon:icon})});_defineProperty(_this,"storeHeight",function(el){if(el){_this.props.setTopbarHeight(el.clientHeight)}});return _this}_inherits(TopBar,_React$Component);return _createClass(TopBar,[{key:"componentDidMount",value:function componentDidMount(){this.setState({allowedToolbarItems:ThemeUtils.allowedItems(this.props.toolbarItems,this.props.currentTheme),allowedMenuItems:ThemeUtils.allowedItems(this.props.menuItems,this.props.currentTheme)})}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){if(this.props.currentTheme!==prevProps.currentTheme){this.setState({allowedToolbarItems:ThemeUtils.allowedItems(this.props.toolbarItems,this.props.currentTheme),allowedMenuItems:ThemeUtils.allowedItems(this.props.menuItems,this.props.currentTheme)})}}},{key:"render",value:function render(){var _this2=this;var logo;var assetsPath=ConfigUtils.getAssetsPath();var isMobile=ConfigUtils.isMobile();if(isMobile){logo=assetsPath+"/img/logo-mobile."+this.props.logoFormat}else{logo=assetsPath+"/img/logo."+this.props.logoFormat}var classes=classnames({TopBar:true,mobile:isMobile,fullscreen:this.props.fullscreen});var logoEl=/*#__PURE__*/React.createElement("img",{className:"topbar-logo",src:this.props.logoSrc||logo});if(this.props.logoUrl){logoEl=/*#__PURE__*/React.createElement("a",{href:this.props.logoUrl,rel:"noreferrer",target:"_blank"},logoEl)}// Convert legacy minScale option to minScaleDenom
|
|
9
|
+
*/var TopBar=/*#__PURE__*/function(_React$Component){function TopBar(){var _this;_classCallCheck(this,TopBar);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_callSuper(this,TopBar,[].concat(args));_defineProperty(_this,"state",{allowedMenuItems:[],allowedToolbarItems:[]});_defineProperty(_this,"openUrl",function(url,target,title,icon){if(target==="iframe"){target=":iframedialog:externallinkiframe"}_this.props.openExternalUrl(url,target,{title:title,icon:icon})});_defineProperty(_this,"storeHeight",function(el){if(el){_this.props.setTopbarHeight(el.clientHeight)}});_defineProperty(_this,"searchTasks",function(text,searchParams,callback){var filter=new RegExp(removeDiacritics(text).replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),"i");var results=[];_this.searchTaskGroup(results,filter,_this.state.allowedMenuItems);if(results.length>0){callback({results:[{id:"tasks",title:LocaleUtils.tr("search.tasks"),type:SearchResultType.TASK,items:results}]})}else{callback({results:[]})}});_defineProperty(_this,"searchTaskGroup",function(results,filter,group){group.forEach(function(item){if(item.subitems){_this.searchTaskGroup(results,filter,item.subitems)}else{var label=item.title?LocaleUtils.tr(item.title):LocaleUtils.tr("appmenu.items."+item.key+(item.mode||""));if(removeDiacritics(label).match(filter)){results.push({id:"tasks:"+results.length,text:label,task:item})}}})});return _this}_inherits(TopBar,_React$Component);return _createClass(TopBar,[{key:"componentDidMount",value:function componentDidMount(){this.setState({allowedToolbarItems:ThemeUtils.allowedItems(this.props.toolbarItems,this.props.currentTheme),allowedMenuItems:ThemeUtils.allowedItems(this.props.menuItems,this.props.currentTheme)});if(this.props.registerTaskSearchProvider){registerSearchProvider("tasksearch",{label:LocaleUtils.tr("search.tasks"),onSearch:this.searchTasks})}}},{key:"componentWillUnmount",value:function componentWillUnmount(){if(this.props.registerTaskSearchProvider){unregisterSearchProvider("tasksearch")}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){if(this.props.currentTheme!==prevProps.currentTheme){this.setState({allowedToolbarItems:ThemeUtils.allowedItems(this.props.toolbarItems,this.props.currentTheme),allowedMenuItems:ThemeUtils.allowedItems(this.props.menuItems,this.props.currentTheme)})}}},{key:"render",value:function render(){var _this2=this;var logo;var assetsPath=ConfigUtils.getAssetsPath();var isMobile=ConfigUtils.isMobile();if(isMobile){logo=assetsPath+"/img/logo-mobile."+this.props.logoFormat}else{logo=assetsPath+"/img/logo."+this.props.logoFormat}var classes=classnames({TopBar:true,mobile:isMobile,fullscreen:this.props.fullscreen});var logoEl=/*#__PURE__*/React.createElement("img",{className:"topbar-logo",src:this.props.logoSrc||logo});if(this.props.logoUrl){logoEl=/*#__PURE__*/React.createElement("a",{href:this.props.logoUrl,rel:"noreferrer",target:"_blank"},logoEl)}// Convert legacy minScale option to minScaleDenom
|
|
10
10
|
var searchOptions=_objectSpread(_objectSpread({},TopBar.defaultProps.searchOptions),this.props.searchOptions);searchOptions.minScaleDenom=searchOptions.minScaleDenom||searchOptions.minScale;delete searchOptions.minScale;// Menu compact only available for desktop client
|
|
11
11
|
var menuCompact=!isMobile?this.props.appMenuCompact:false;// Keep menu open when appMenu is in compact mode (Visible on Hover)
|
|
12
12
|
var keepMenuOpen=menuCompact;// Menu should be visible on startup when appMenu is in compact mode (Visible on Hover)
|
|
13
|
-
var showOnStartup=this.props.appMenuVisibleOnStartup||menuCompact;var style={marginLeft:this.props.mapMargins.outerLeft+"px",marginRight:this.props.mapMargins.outerRight+"px"};return/*#__PURE__*/React.createElement(Swipeable,{onSwipedDown:function onSwipedDown(){return _this2.props.toggleFullscreen(false)},onSwipedUp:function onSwipedUp(){return _this2.props.toggleFullscreen(true)}},/*#__PURE__*/React.createElement("div",{className:classes,ref:this.storeHeight,style:style},logoEl,/*#__PURE__*/React.createElement("div",{className:"topbar-center-span"},this.props.components.Search?/*#__PURE__*/React.createElement("div",{className:"topbar-search-container"},/*#__PURE__*/React.createElement(this.props.components.Search,{searchOptions:searchOptions})):null,this.props.components.Toolbar?/*#__PURE__*/React.createElement(this.props.components.Toolbar,{openExternalUrl:this.openUrl,toolbarItems:this.state.allowedToolbarItems,toolbarItemsShortcutPrefix:this.props.toolbarItemsShortcutPrefix}):null),this.props.components.AppMenu&&!this.props.appMenuHidden?/*#__PURE__*/React.createElement(this.props.components.AppMenu,{appMenuClearsTask:this.props.appMenuClearsTask,appMenuShortcut:this.props.appMenuShortcut,buttonLabel:LocaleUtils.tr("appmenu.menulabel"),keepMenuOpen:keepMenuOpen,menuCompact:menuCompact,menuItems:this.state.allowedMenuItems,openExternalUrl:this.openUrl,showFilterField:this.props.appMenuFilterField,showOnStartup:showOnStartup}):null,this.props.components.FullscreenSwitcher?/*#__PURE__*/React.createElement(this.props.components.FullscreenSwitcher,null):null))}}])}(React.Component);_defineProperty(TopBar,"propTypes",{/** Whether opening the app menu clears the active task. */appMenuClearsTask:PropTypes.bool,/** Whether show an appMenu compact (menu visible on icons hover) - Only available for desktop client. */appMenuCompact:PropTypes.bool,/** Whether to display the filter field in the app menu. */appMenuFilterField:PropTypes.bool,/** Whether to hide the app menu (useful primarely as a theme specific setting). */appMenuHidden:PropTypes.bool,/** The shortcut for tiggering the app menu, i.e. alt+shift+m. */appMenuShortcut:PropTypes.string,/** Whether to open the app menu on application startup. */appMenuVisibleOnStartup:PropTypes.bool,components:PropTypes.object,currentTheme:PropTypes.object,fullscreen:PropTypes.bool,/** The logo file format. */logoFormat:PropTypes.string,/** The logo image URL if a different source than the default `assets/img/logo.<ext>` and `assets/img/logo-mobile.<ext>` is desired. */logoSrc:PropTypes.string,/** The hyperlink to open when the logo is clicked. */logoUrl:PropTypes.string,mapMargins:PropTypes.object,/** The menu items. Refer to the corresponding chapter of the viewer documentation and the sample config.json. */menuItems:PropTypes.array,openExternalUrl:PropTypes.func,/** Options passed down to the search component. */searchOptions:PropTypes.shape({/** Whether to show the search filter widget. */allowSearchFilters:PropTypes.bool,/** Whether to hide the result labels on the map. */hideResultLabels:PropTypes.bool,/** The style used for highlighting search result geometries. */highlightStyle:PropTypes.shape({/* Stroke color rgba array, i.e. [255, 0, 0, 0.5] */strokeColor:PropTypes.array,/* Stroke width */strokeWidth:PropTypes.number,/* Stroke dash/gap pattern array. Empty for solid line. */strokeDash:PropTypes.array,/* Fill color rgba array, i.e. [255, 0, 0, 0.33] */fillColor:PropTypes.array}),/** Minimum scale denominator when zooming to search result. */minScaleDenom:PropTypes.number,/** Result count limit which is passed to the search provider. */resultLimit:PropTypes.number,/** Whether to collapse search sections by default. */sectionsDefaultCollapsed:PropTypes.bool,/** Whether to show a highlight marker in the center of the search result geometry. */showHighlightMarker:PropTypes.bool,/** Whether to show the layer tree after selecting a theme result. */showLayerAfterChangeTheme:PropTypes.bool,/** Whether to show layer results before pkaces in the result menu. */showLayerResultsBeforePlaces:PropTypes.bool,/** Whether to replace the search text with the selected search result text. */showResultInSearchText:PropTypes.bool,/** Whether to zoom to layer search results. */zoomToLayers:PropTypes.bool}),setTopbarHeight:PropTypes.func,toggleFullscreen:PropTypes.func,/** The toolbar. Refer to the corresponding chapter of the viewer documentation and the sample config.json. */toolbarItems:PropTypes.array,/** The keyboard shortcut prefix for triggering toolbar tasks. I.e. alt+shift. The task are then triggered by <prefix>+{1,2,3,...} for the 1st, 2nd, 3rd... toolbar icon. */toolbarItemsShortcutPrefix:PropTypes.string});_defineProperty(TopBar,"defaultProps",{searchOptions:{showHighlightMarker:true,showResultInSearchText:true,minScaleDenom:1000},menuItems:[],toolbarItems:[],logoFormat:"svg"});export default(function(components){return connect(function(state){return{fullscreen:state.display.fullscreen,components:components,currentTheme:state.theme.current,mapMargins:state.windows.mapMargins}},{toggleFullscreen:toggleFullscreen,openExternalUrl:openExternalUrl,setTopbarHeight:setTopbarHeight})(TopBar)});
|
|
13
|
+
var showOnStartup=this.props.appMenuVisibleOnStartup||menuCompact;var style={marginLeft:this.props.mapMargins.outerLeft+"px",marginRight:this.props.mapMargins.outerRight+"px"};return/*#__PURE__*/React.createElement(Swipeable,{onSwipedDown:function onSwipedDown(){return _this2.props.toggleFullscreen(false)},onSwipedUp:function onSwipedUp(){return _this2.props.toggleFullscreen(true)}},/*#__PURE__*/React.createElement("div",{className:classes,ref:this.storeHeight,style:style},logoEl,/*#__PURE__*/React.createElement("div",{className:"topbar-center-span"},this.props.components.Search?/*#__PURE__*/React.createElement("div",{className:"topbar-search-container"},/*#__PURE__*/React.createElement(this.props.components.Search,{searchOptions:searchOptions})):null,this.props.components.Toolbar?/*#__PURE__*/React.createElement(this.props.components.Toolbar,{openExternalUrl:this.openUrl,toolbarItems:this.state.allowedToolbarItems,toolbarItemsShortcutPrefix:this.props.toolbarItemsShortcutPrefix}):null),this.props.components.AppMenu&&!this.props.appMenuHidden?/*#__PURE__*/React.createElement(this.props.components.AppMenu,{appMenuClearsTask:this.props.appMenuClearsTask,appMenuShortcut:this.props.appMenuShortcut,buttonLabel:LocaleUtils.tr("appmenu.menulabel"),keepMenuOpen:keepMenuOpen,menuCompact:menuCompact,menuItems:this.state.allowedMenuItems,openExternalUrl:this.openUrl,showFilterField:this.props.appMenuFilterField,showOnStartup:showOnStartup}):null,this.props.components.FullscreenSwitcher?/*#__PURE__*/React.createElement(this.props.components.FullscreenSwitcher,null):null))}}])}(React.Component);_defineProperty(TopBar,"propTypes",{/** Whether opening the app menu clears the active task. */appMenuClearsTask:PropTypes.bool,/** Whether show an appMenu compact (menu visible on icons hover) - Only available for desktop client. */appMenuCompact:PropTypes.bool,/** Whether to display the filter field in the app menu. */appMenuFilterField:PropTypes.bool,/** Whether to hide the app menu (useful primarely as a theme specific setting). */appMenuHidden:PropTypes.bool,/** The shortcut for tiggering the app menu, i.e. alt+shift+m. */appMenuShortcut:PropTypes.string,/** Whether to open the app menu on application startup. */appMenuVisibleOnStartup:PropTypes.bool,components:PropTypes.object,currentTheme:PropTypes.object,fullscreen:PropTypes.bool,/** The logo file format. */logoFormat:PropTypes.string,/** The logo image URL if a different source than the default `assets/img/logo.<ext>` and `assets/img/logo-mobile.<ext>` is desired. */logoSrc:PropTypes.string,/** The hyperlink to open when the logo is clicked. */logoUrl:PropTypes.string,mapMargins:PropTypes.object,/** The menu items. Refer to the corresponding chapter of the viewer documentation and the sample config.json. */menuItems:PropTypes.array,openExternalUrl:PropTypes.func,/** Whether to register a search provider which allows searching menu tasks through the global search field. */registerTaskSearchProvider:PropTypes.bool,/** Options passed down to the search component. */searchOptions:PropTypes.shape({/** Whether to show the search filter widget. */allowSearchFilters:PropTypes.bool,/** Whether to hide the result labels on the map. */hideResultLabels:PropTypes.bool,/** The style used for highlighting search result geometries. */highlightStyle:PropTypes.shape({/* Stroke color rgba array, i.e. [255, 0, 0, 0.5] */strokeColor:PropTypes.array,/* Stroke width */strokeWidth:PropTypes.number,/* Stroke dash/gap pattern array. Empty for solid line. */strokeDash:PropTypes.array,/* Fill color rgba array, i.e. [255, 0, 0, 0.33] */fillColor:PropTypes.array}),/** Minimum scale denominator when zooming to search result. */minScaleDenom:PropTypes.number,/** Result count limit which is passed to the search provider. */resultLimit:PropTypes.number,/** Whether to collapse search sections by default. */sectionsDefaultCollapsed:PropTypes.bool,/** Whether to show a highlight marker in the center of the search result geometry. */showHighlightMarker:PropTypes.bool,/** Whether to show the layer tree after selecting a theme result. */showLayerAfterChangeTheme:PropTypes.bool,/** Whether to show layer results before pkaces in the result menu. */showLayerResultsBeforePlaces:PropTypes.bool,/** Whether to replace the search text with the selected search result text. */showResultInSearchText:PropTypes.bool,/** Whether to zoom to layer search results. */zoomToLayers:PropTypes.bool}),setTopbarHeight:PropTypes.func,toggleFullscreen:PropTypes.func,/** The toolbar. Refer to the corresponding chapter of the viewer documentation and the sample config.json. */toolbarItems:PropTypes.array,/** The keyboard shortcut prefix for triggering toolbar tasks. I.e. alt+shift. The task are then triggered by <prefix>+{1,2,3,...} for the 1st, 2nd, 3rd... toolbar icon. */toolbarItemsShortcutPrefix:PropTypes.string});_defineProperty(TopBar,"defaultProps",{searchOptions:{showHighlightMarker:true,showResultInSearchText:true,minScaleDenom:1000},menuItems:[],toolbarItems:[],logoFormat:"svg"});export default(function(components){return connect(function(state){return{fullscreen:state.display.fullscreen,components:components,currentTheme:state.theme.current,mapMargins:state.windows.mapMargins}},{toggleFullscreen:toggleFullscreen,openExternalUrl:openExternalUrl,setTopbarHeight:setTopbarHeight})(TopBar)});
|
|
@@ -6,7 +6,7 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/import React from"react";import{connect}from"react-redux";import Mousetrap from"mousetrap";import ol from"openlayers";import PropTypes from"prop-types";import{v4 as uuidv4}from"uuid";import{LayerRole,addLayerFeatures,removeLayerFeatures}from"../../actions/layers";import{changeRedliningState}from"../../actions/redlining";import NumericInputWindow from"../../components/NumericInputWindow";import{OlLayerAdded,OlLayerUpdated}from"../../components/map/OlLayer";import FeatureStyles from"../../utils/FeatureStyles";import MapUtils from"../../utils/MapUtils";import MeasureUtils from"../../utils/MeasureUtils";import VectorLayerUtils from"../../utils/VectorLayerUtils";var GeomTypeConfig={Text:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"Point"}))},editTool:"Pick",drawNodes:true},Point:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"Point"}))},editTool:"Pick",drawNodes:true},LineString:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"LineString"}))},editTool:"Pick",drawNodes:true},Polygon:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"Polygon"}))},editTool:"Pick",drawNodes:true},Circle:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"Circle"}))},editTool:"Pick",drawNodes:true,regular:true},Ellipse:{drawInteraction:function drawInteraction(opts){return new ol.interaction.DrawRegular(_objectSpread(_objectSpread({},opts),{},{sides:0}))},editTool:"Transform",drawNodes:false},Box:{drawInteraction:function drawInteraction(opts){return new ol.interaction.Draw(_objectSpread(_objectSpread({},opts),{},{type:"Circle",geometryFunction:ol.interaction.createBox()}))},editTool:"Transform",drawNodes:true},Square:{drawInteraction:function drawInteraction(opts){return new ol.interaction.DrawRegular(_objectSpread(_objectSpread({},opts),{},{sides:4,squareCondition:function squareCondition(){return true}}))},editTool:"Transform",regular:true}};/**
|
|
8
8
|
* Redlining support for the map component.
|
|
9
|
-
*/var RedliningSupport=/*#__PURE__*/function(_React$Component){function RedliningSupport(props){var _this;_classCallCheck(this,RedliningSupport);_this=_callSuper(this,RedliningSupport,[props]);_defineProperty(_this,"updateCurrentFeature",function(feature){if(_this.currentFeature&&_this.props.redlining.selectedFeature){if(feature.circleParams){var circleParams=feature.circleParams;_this.currentFeature.setGeometry(new ol.geom.Circle(circleParams.center,circleParams.radius))}else{_this.currentFeature.getGeometry().setCoordinates(feature.geometry.coordinates)}_this.props.changeRedliningState({selectedFeature:feature,geomType:feature.shape})}});_defineProperty(_this,"styleOptions",function(styleProps,isText){return{strokeColor:isText?styleProps.textOutlineColor:styleProps.borderColor,strokeWidth:1+0.5*styleProps.size,fillColor:isText?styleProps.textFillColor:styleProps.fillColor,circleRadius:5+styleProps.size,
|
|
9
|
+
*/var RedliningSupport=/*#__PURE__*/function(_React$Component){function RedliningSupport(props){var _this;_classCallCheck(this,RedliningSupport);_this=_callSuper(this,RedliningSupport,[props]);_defineProperty(_this,"updateCurrentFeature",function(feature){if(_this.currentFeature&&_this.props.redlining.selectedFeature){if(feature.circleParams){var circleParams=feature.circleParams;_this.currentFeature.setGeometry(new ol.geom.Circle(circleParams.center,circleParams.radius))}else{_this.currentFeature.getGeometry().setCoordinates(feature.geometry.coordinates)}_this.props.changeRedliningState({selectedFeature:feature,geomType:feature.shape})}});_defineProperty(_this,"styleOptions",function(styleProps,isText){return{strokeColor:isText?styleProps.textOutlineColor:styleProps.borderColor,strokeWidth:1+0.5*styleProps.size,strokeDash:styleProps.strokeDash,fillColor:isText?styleProps.textFillColor:styleProps.fillColor,circleRadius:5+styleProps.size,headmarker:styleProps.headmarker,tailmarker:styleProps.tailmarker}});_defineProperty(_this,"styleProps",function(feature){var styleOptions=feature.get("styleOptions");var label=feature.get("label")||"";var isText=feature.get("shape")==="Text";return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},isText?"textOutlineColor":"borderColor",styleOptions.strokeColor),"strokeDash",styleOptions.strokeDash),"size",(styleOptions.strokeWidth-1)*2),isText?"textFillColor":"fillColor",styleOptions.fillColor),"text",label),"headmarker",styleOptions.headmarker),"tailmarker",styleOptions.tailmarker)});_defineProperty(_this,"updateFeatureStyle",function(styleProps){var isText=_this.currentFeature.get("shape")==="Text";var styleName=isText?"text":"default";var opts=_this.styleOptions(styleProps,isText);_this.blockOnChange=true;_this.currentFeature.set("label",styleProps.text);_this.currentFeature.set("styleName",styleName);_this.currentFeature.set("styleOptions",opts);_this.blockOnChange=false});_defineProperty(_this,"styleFunction",function(feature){var styleOptions=feature.get("styleOptions");var styleName=feature.get("styleName");var styles=[];if(styleName==="text"){styles.push(_this.selectedTextStyle(feature,styleOptions))}styles.push.apply(styles,_toConsumableArray(FeatureStyles[styleName](feature,styleOptions)));var shape=feature.get("shape");var geomTypeConfig=GeomTypeConfig[shape];if((geomTypeConfig||{}).drawNodes!==false){styles.push(_this.selectedStyle)}return styles});_defineProperty(_this,"setCurrentFeature",function(feature){var _featureObj$shape;_this.currentFeature=feature;_this.currentFeature.setStyle(_this.styleFunction);var circleParams=_this.currentFeature.get("circleParams");if(circleParams){_this.currentFeature.setGeometry(new ol.geom.Circle(circleParams.center,circleParams.radius))}var measurements=_this.currentFeature.get("measurements");var featureObj=_this.currentFeatureObject();var newRedliningState={style:_this.styleProps(_this.currentFeature),measurements:!!_this.currentFeature.get("measurements"),selectedFeature:featureObj,geomType:(_featureObj$shape=featureObj===null||featureObj===void 0?void 0:featureObj.shape)!==null&&_featureObj$shape!==void 0?_featureObj$shape:_this.props.redlining.geomType};if(measurements){newRedliningState.lenUnit=measurements.lenUnit;newRedliningState.areaUnit=measurements.areaUnit}_this.props.changeRedliningState(newRedliningState);_this.currentFeature.on("change",_this.updateMeasurements)});_defineProperty(_this,"addDrawInteraction",function(){var geomTypeConfig=GeomTypeConfig[_this.props.redlining.geomType];if(!geomTypeConfig){return}var isFreeHand=_this.props.redlining.freehand;var drawInteraction=geomTypeConfig.drawInteraction({stopClick:true,condition:function condition(event){return event.originalEvent.buttons===1},style:function style(){return _this.picking?[]:FeatureStyles.sketchInteraction()},freehand:isFreeHand});drawInteraction.on("drawstart",function(evt){if(_this.picking&&_this.props.redlining.drawMultiple===false){return}_this.leaveTemporaryEditMode();_this.currentFeature=evt.feature;_this.currentFeature.setId(uuidv4());_this.currentFeature.set("shape",_this.props.redlining.geomType);_this.currentFeature.setStyle(_this.styleFunction);_this.updateFeatureStyle(_this.props.redlining.style);_this.currentFeature.on("change",_this.updateMeasurements)},_this);drawInteraction.on("drawend",function(){var featureId=_this.currentFeature.getId();_this.commitCurrentFeature(_this.props.redlining,true);_this.enterTemporaryEditMode(featureId,_this.props.redlining.layer,geomTypeConfig.editTool)},_this);_this.props.map.addInteraction(drawInteraction);_this.interactions.push(drawInteraction)});_defineProperty(_this,"updateMeasurements",function(){if(_this.blockOnChange||!_this.currentFeature){return}var feature=_this.currentFeature;var hadMeasurements=!!feature.get("measurements");if(_this.props.redlining.measurements){var settings={displayCrs:_this.props.displayCrs,lenUnit:_this.props.redlining.lenUnit,areaUnit:_this.props.redlining.areaUnit};MeasureUtils.updateFeatureMeasurements(feature,feature.get("shape"),_this.props.mapCrs,settings)}else if(hadMeasurements){feature.set("measurements",undefined);feature.set("segment_labels",undefined);feature.set("label","")}});_defineProperty(_this,"waitForFeatureAndLayer",function(layerId,featureId,callback){var redliningLayer=_this.searchRedliningLayer(layerId);if(!redliningLayer){OlLayerAdded.connect(function(layer){if(layer.get("id")===layerId){var feature=featureId?layer.getSource().getFeatureById(featureId):null;callback(layer,feature);return true}return false})}else if(featureId){var feature=redliningLayer.getSource().getFeatureById(featureId);if(feature){callback(redliningLayer,feature)}else{OlLayerUpdated.connect(function(layer){if(layer.get("id")===layerId){var feat=layer.getSource().getFeatureById(featureId);if(feat){callback(layer,feat);return true}}return false})}}else{callback(redliningLayer,null)}});_defineProperty(_this,"enterTemporaryEditMode",function(featureId,layerId,editTool){_this.waitForFeatureAndLayer(layerId,featureId,function(redliningLayer,feature){if(!feature){return}_this.setCurrentFeature(feature);if(editTool==="Transform"){_this.setupTransformInteraction([_this.currentFeature])}else{_this.setupModifyInteraction([_this.currentFeature])}_this.picking=true})});_defineProperty(_this,"leaveTemporaryEditMode",function(){if(_this.currentFeature){_this.commitCurrentFeature(_this.props.redlining)}if(_this.picking){// Remove modify interactions
|
|
10
10
|
_this.props.map.removeInteraction(_this.interactions.pop());_this.picking=false}});_defineProperty(_this,"addPickInteraction",function(){var redliningLayer=_this.searchRedliningLayer(_this.props.redlining.layer);if(!redliningLayer){return}var selectInteraction=new ol.interaction.Select({layers:[redliningLayer],hitTolerance:5});var currentEditInteraction=null;selectInteraction.on("select",function(evt){if(evt.selected.length===1&&evt.selected[0]===_this.currentFeature){return}if(_this.currentFeature){_this.commitCurrentFeature(_this.props.redlining)}if(currentEditInteraction){_this.props.map.removeInteraction(currentEditInteraction);_this.interactions=_this.interactions.filter(function(i){return i!==currentEditInteraction});currentEditInteraction=null}if(evt.selected.length===1){_this.setCurrentFeature(evt.selected[0]);var geomTypeConfig=GeomTypeConfig[_this.currentFeature.get("shape")];if(geomTypeConfig&&geomTypeConfig.editTool==="Transform"){currentEditInteraction=_this.setupTransformInteraction([_this.currentFeature]);currentEditInteraction.on("select",function(ev){// Clear selection when selecting a different feature, and let the parent select interaction deal with the new feature
|
|
11
11
|
if(_this.currentFeature&&ev.feature!==_this.currentFeature){_this.commitCurrentFeature(_this.props.redlining);currentEditInteraction.setSelection(new ol.Collection)}})}else{currentEditInteraction=_this.setupModifyInteraction(selectInteraction.getFeatures().getArray())}}},_this);if(_this.props.redlining.action==="PickDraw"){_this.props.map.on("click",_this.maybeEnterTemporaryDrawMode)}_this.props.map.addInteraction(selectInteraction);_this.interactions.push(selectInteraction);_this.picking=true});_defineProperty(_this,"addTransformInteraction",function(){var redliningLayer=_this.searchRedliningLayer(_this.props.redlining.layer);if(!redliningLayer){return}var transformInteraction=_this.setupTransformInteraction();transformInteraction.on("select",function(evt){if(evt.feature===_this.currentFeature){return}if(_this.currentFeature){_this.commitCurrentFeature(_this.props.redlining)}if(evt.feature){_this.setCurrentFeature(evt.feature)}});_this.picking=true});_defineProperty(_this,"addPickDrawInteraction",function(){_this.waitForFeatureAndLayer(_this.props.redlining.layer,null,function(){return _this.addPickInteraction()})});_defineProperty(_this,"maybeEnterTemporaryDrawMode",function(ev){var redliningLayer=_this.searchRedliningLayer(_this.props.redlining.layer);if(_this.currentFeature||!_this.props.redlining.drawMultiple&&redliningLayer.getSource().getFeatures().length>0){return}var featureHit=false;_this.props.map.forEachFeatureAtPixel(ev.pixel,function(feature,layer){featureHit|=layer===redliningLayer},{hitTolerance:5});if(!redliningLayer||featureHit){return}_this.reset(_this.props.redlining);_this.props.map.un("click",_this.maybeEnterTemporaryDrawMode);var geomTypeConfig=GeomTypeConfig[_this.props.redlining.geomType];if(!geomTypeConfig){return}var isFreeHand=_this.props.redlining.freehand;var drawInteraction=geomTypeConfig.drawInteraction({stopClick:true,condition:function condition(event){return event.originalEvent.buttons===1},style:function style(){return _this.picking?[]:FeatureStyles.sketchInteraction()},freehand:isFreeHand});drawInteraction.on("drawstart",function(evt){_this.currentFeature=evt.feature;_this.currentFeature.setId(uuidv4());_this.currentFeature.set("shape",_this.props.redlining.geomType);_this.currentFeature.setStyle(_this.styleFunction);_this.updateFeatureStyle(_this.props.redlining.style);_this.currentFeature.on("change",_this.updateMeasurements)},_this);drawInteraction.on("drawend",function(){// Draw end
|
|
12
12
|
_this.commitCurrentFeature(_this.props.redlining,true);_this.reset(_this.props.redlining);// Ughh... Apparently we need to wait 250ms for the 'singleclick' event processing to finish to avoid pick interactions picking up the current event
|
|
@@ -35,8 +35,13 @@ form.feature-search-form > fieldset table {
|
|
|
35
35
|
width: 100%;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
form.feature-search-form > fieldset td:first-child {
|
|
39
|
+
width: 1%;
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
form.feature-search-form > fieldset td > input,
|
|
39
|
-
form.feature-search-form > fieldset td > select
|
|
43
|
+
form.feature-search-form > fieldset td > select,
|
|
44
|
+
form.feature-search-form > fieldset td > div.input-container {
|
|
40
45
|
width: 100%;
|
|
41
46
|
}
|
|
42
47
|
|
package/reducers/redlining.js
CHANGED
|
@@ -4,4 +4,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/import{CHANGE_REDLINING_STATE,RESET_REDLINING_STATE}from"../actions/redlining";var defaultState={action:null,geomType:null,style:{borderColor:[255,0,0,1],fillColor:[255,255,255,1],size:2,text:"",textOutlineColor:[255,255,255,1],textFillColor:[0,0,0,1]},layer:null,layerTitle:null,selectedFeature:null,drawMultiple:true,freehand:false,measurements:false,numericInput:false,lenUnit:"metric",areaUnit:"metric"};export default function redlining(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case CHANGE_REDLINING_STATE:{return _objectSpread(_objectSpread(_objectSpread({},state),action.data),{},{style:_objectSpread(_objectSpread({},state.style),action.data.style)})}case RESET_REDLINING_STATE:{return defaultState}default:return state}}
|
|
7
|
+
*/import{CHANGE_REDLINING_STATE,RESET_REDLINING_STATE}from"../actions/redlining";var defaultState={action:null,geomType:null,style:{borderColor:[255,0,0,1],fillColor:[255,255,255,1],strokeDash:[],size:2,text:"",textOutlineColor:[255,255,255,1],textFillColor:[0,0,0,1]},layer:null,layerTitle:null,selectedFeature:null,drawMultiple:true,freehand:false,measurements:false,numericInput:false,lenUnit:"metric",areaUnit:"metric"};export default function redlining(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case CHANGE_REDLINING_STATE:{return _objectSpread(_objectSpread(_objectSpread({},state),action.data),{},{style:_objectSpread(_objectSpread({},state.style),action.data.style)})}case RESET_REDLINING_STATE:{return defaultState}default:return state}}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 6.3499999 6.3499999"
|
|
8
|
+
version="1.1"
|
|
9
|
+
id="svg1"
|
|
10
|
+
sodipodi:docname="rotate.svg"
|
|
11
|
+
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
|
12
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
13
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
16
|
+
<sodipodi:namedview
|
|
17
|
+
id="namedview1"
|
|
18
|
+
pagecolor="#aaaaaa"
|
|
19
|
+
bordercolor="#666666"
|
|
20
|
+
borderopacity="1.0"
|
|
21
|
+
inkscape:showpageshadow="2"
|
|
22
|
+
inkscape:pageopacity="0.0"
|
|
23
|
+
inkscape:pagecheckerboard="0"
|
|
24
|
+
inkscape:deskcolor="#d1d1d1"
|
|
25
|
+
inkscape:document-units="px"
|
|
26
|
+
showgrid="true"
|
|
27
|
+
inkscape:zoom="20.016598"
|
|
28
|
+
inkscape:cx="11.140754"
|
|
29
|
+
inkscape:cy="17.760261"
|
|
30
|
+
inkscape:window-width="1920"
|
|
31
|
+
inkscape:window-height="1172"
|
|
32
|
+
inkscape:window-x="0"
|
|
33
|
+
inkscape:window-y="0"
|
|
34
|
+
inkscape:window-maximized="1"
|
|
35
|
+
inkscape:current-layer="layer1">
|
|
36
|
+
<inkscape:grid
|
|
37
|
+
id="grid1"
|
|
38
|
+
units="px"
|
|
39
|
+
originx="0"
|
|
40
|
+
originy="0"
|
|
41
|
+
spacingx="0.26458333"
|
|
42
|
+
spacingy="0.26458333"
|
|
43
|
+
empcolor="#0099e5"
|
|
44
|
+
empopacity="0.30196078"
|
|
45
|
+
color="#0099e5"
|
|
46
|
+
opacity="0.14901961"
|
|
47
|
+
empspacing="5"
|
|
48
|
+
enabled="true"
|
|
49
|
+
visible="true" />
|
|
50
|
+
</sodipodi:namedview>
|
|
51
|
+
<defs
|
|
52
|
+
id="defs1" />
|
|
53
|
+
<g
|
|
54
|
+
inkscape:label="Layer 1"
|
|
55
|
+
inkscape:groupmode="layer"
|
|
56
|
+
id="layer1">
|
|
57
|
+
<g
|
|
58
|
+
id="path1"
|
|
59
|
+
style="opacity:1;stroke:#ffffff;stroke-width:0.264583;stroke-dasharray:none;stroke-opacity:1"
|
|
60
|
+
transform="matrix(0.95663197,0,0,-0.95663197,0.13748225,0.13769358)">
|
|
61
|
+
<path
|
|
62
|
+
id="path5"
|
|
63
|
+
style="baseline-shift:baseline;display:inline;overflow:visible;stroke:#ffffff;stroke-width:0.264583;stroke-dasharray:none;stroke-opacity:1;enable-background:accumulate;stop-color:#000000;stop-opacity:1"
|
|
64
|
+
d="M 3.7662556,-0.09849442 A 0.29124982,0.29124982 0 0 1 3.476956,-0.48165371 L 4.1384443,-2.4657119 A 0.36000457,0.36000457 0 0 1 4.734515,-2.6062984 l 0.2653266,0.2653267 c 0.4360862,-0.790633 0.3181887,-1.7991424 -0.3543106,-2.4716417 -0.8159143,-0.8159144 -2.1250265,-0.8159144 -2.9409407,0 -0.81591427,0.8159142 -0.81591427,2.1262452 0,2.9421596 l -0.5895696,0.5883507 c -1.13391648,-1.1339167 -1.13391649,-2.9849444 0,-4.118861 0.5669584,-0.5669582 1.3129828,-0.8508331 2.0592273,-0.850833 0.7462445,0 1.4938944,0.2838748 2.0608527,0.850833 0.9929357,0.9929357 1.1161877,2.5357627 0.3701569,3.6654083 -6.42e-5,9.74e-5 6.44e-5,3.09e-4 0,4.064e-4 l 0.364875,0.3644685 a 0.36000457,0.36000457 0 0 1 -0.1409929,0.59607082 l -1.9836518,0.66148816 a 0.29124982,0.29124982 0 0 1 -0.079232,0.0146275 z" />
|
|
65
|
+
<g
|
|
66
|
+
id="g4"
|
|
67
|
+
style="stroke:#ffffff;stroke-width:0.264583;stroke-dasharray:none;stroke-opacity:1" />
|
|
68
|
+
</g>
|
|
69
|
+
</g>
|
|
70
|
+
</svg>
|
|
@@ -479,7 +479,6 @@
|
|
|
479
479
|
"loading": "Зареждане на формуляра..."
|
|
480
480
|
},
|
|
481
481
|
"redlining": {
|
|
482
|
-
"border": "Граница",
|
|
483
482
|
"buffer": "Буфер",
|
|
484
483
|
"buffercompute": "Изчисляване",
|
|
485
484
|
"bufferdistance": "Разстояние",
|
|
@@ -507,8 +506,7 @@
|
|
|
507
506
|
"size": "Размер",
|
|
508
507
|
"square": "Квадрат",
|
|
509
508
|
"text": "Текст",
|
|
510
|
-
"transform": "Преобразуване"
|
|
511
|
-
"width": "Ширина"
|
|
509
|
+
"transform": "Преобразуване"
|
|
512
510
|
},
|
|
513
511
|
"reports": {
|
|
514
512
|
"all": "Всички",
|
|
@@ -579,6 +577,7 @@
|
|
|
579
577
|
"providerselection": "Търсене на доставчици",
|
|
580
578
|
"recent": "Последни търсения",
|
|
581
579
|
"search": "Търсене",
|
|
580
|
+
"tasks": "",
|
|
582
581
|
"themelayers": "Тематични слоеве",
|
|
583
582
|
"themes": "Теми",
|
|
584
583
|
"unknownmore": ""
|
|
@@ -479,7 +479,6 @@
|
|
|
479
479
|
"loading": "Carregant formulari..."
|
|
480
480
|
},
|
|
481
481
|
"redlining": {
|
|
482
|
-
"border": "Límit",
|
|
483
482
|
"buffer": "Buffer",
|
|
484
483
|
"buffercompute": "Computar",
|
|
485
484
|
"bufferdistance": "Distància",
|
|
@@ -507,8 +506,7 @@
|
|
|
507
506
|
"size": "Tamany",
|
|
508
507
|
"square": "Quadrat",
|
|
509
508
|
"text": "Text",
|
|
510
|
-
"transform": "Transformar"
|
|
511
|
-
"width": "Amplada"
|
|
509
|
+
"transform": "Transformar"
|
|
512
510
|
},
|
|
513
511
|
"reports": {
|
|
514
512
|
"all": "Tot",
|
|
@@ -579,6 +577,7 @@
|
|
|
579
577
|
"providerselection": "Proveidor",
|
|
580
578
|
"recent": "Cerques recents",
|
|
581
579
|
"search": "Buscar",
|
|
580
|
+
"tasks": "",
|
|
582
581
|
"themelayers": "Capes del tema",
|
|
583
582
|
"themes": "Temes",
|
|
584
583
|
"unknownmore": "Més resultats"
|
|
@@ -479,7 +479,6 @@
|
|
|
479
479
|
"loading": ""
|
|
480
480
|
},
|
|
481
481
|
"redlining": {
|
|
482
|
-
"border": "Okraj",
|
|
483
482
|
"buffer": "",
|
|
484
483
|
"buffercompute": "",
|
|
485
484
|
"bufferdistance": "",
|
|
@@ -507,8 +506,7 @@
|
|
|
507
506
|
"size": "Velikost",
|
|
508
507
|
"square": "",
|
|
509
508
|
"text": "Text",
|
|
510
|
-
"transform": ""
|
|
511
|
-
"width": "Šířka"
|
|
509
|
+
"transform": ""
|
|
512
510
|
},
|
|
513
511
|
"reports": {
|
|
514
512
|
"all": "",
|
|
@@ -579,6 +577,7 @@
|
|
|
579
577
|
"providerselection": "Poskytovatelé vyhledávání",
|
|
580
578
|
"recent": "Nedávná hledání",
|
|
581
579
|
"search": "Hledat",
|
|
580
|
+
"tasks": "",
|
|
582
581
|
"themelayers": "",
|
|
583
582
|
"themes": "Témata",
|
|
584
583
|
"unknownmore": ""
|