From f4b5efee995536856d6158c6688c04fc33255b0d Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Wed, 30 Aug 2023 16:14:32 +0200 Subject: [PATCH 01/15] Add case "graduatedSymbol" to getlegendgraphic filter. --- g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py b/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py index 1dadaec3b..bff39970b 100644 --- a/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py +++ b/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py @@ -72,7 +72,7 @@ def responseComplete(self): renderer = layer.renderer() - if renderer.type() in ("categorizedSymbol", "ruleBased", "graduatedSymbol"): + if renderer.type() in ("categorizedSymbol", "ruleBased", "graduatedSymbol","graduatedSymbol"): body = handler.body() json_data = json.loads(bytes(body)) categories = {item.label(): {'ruleKey': item.ruleKey(), 'checked': renderer.legendSymbolItemChecked( From a5dda64b41833adcee1101f264c86398ae234199 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Mon, 11 Sep 2023 11:15:42 +0200 Subject: [PATCH 02/15] Fix relation's fields info for 1:N relation. --- g3w-admin/qdjango/utils/data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g3w-admin/qdjango/utils/data.py b/g3w-admin/qdjango/utils/data.py index f0fe5b84a..3061f79c9 100644 --- a/g3w-admin/qdjango/utils/data.py +++ b/g3w-admin/qdjango/utils/data.py @@ -1234,8 +1234,8 @@ def _getDataLayerRelations(self): field_refs.append([referencingField, referencedField]) attrib.update({ 'fieldRef': { - 'referencingField': field_refs[0][0], - 'referencedField': field_refs[0][1] + 'referencingField': field_refs[0], + 'referencedField': field_refs[1] } }) From 46d12ac0e4acdb75a394dc635c9f9d6d433e3989 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Mon, 11 Sep 2023 12:16:48 +0200 Subject: [PATCH 03/15] Fix mixing referencing and referenced fields. --- g3w-admin/core/tests/test_api.py | 3 ++- g3w-admin/qdjango/utils/data.py | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/g3w-admin/core/tests/test_api.py b/g3w-admin/core/tests/test_api.py index 84be4c798..ef4e50772 100644 --- a/g3w-admin/core/tests/test_api.py +++ b/g3w-admin/core/tests/test_api.py @@ -634,7 +634,8 @@ def testCoreInterfaceOwsView(self): self.assertEqual(len(jres['layers']), 21) self.assertEqual(jres['layers'][1]['title'], 'Acque - AdT Catasto Terreni') - self.assertEqual(len(jres['layers'][1]['crss']), 19) + print(jres['layers'][1]['crss']) + self.assertEqual(len(jres['layers'][1]['crss']), 20) def test_crs_api_rest(self): diff --git a/g3w-admin/qdjango/utils/data.py b/g3w-admin/qdjango/utils/data.py index 3061f79c9..c678ed409 100644 --- a/g3w-admin/qdjango/utils/data.py +++ b/g3w-admin/qdjango/utils/data.py @@ -1229,13 +1229,15 @@ def _getDataLayerRelations(self): 'referencingLayer': relation.referencingLayerId(), } # get only first pair relation - field_refs = [] + fields_referenging = [] + fields_referenced = [] for referencingField, referencedField in relation.fieldPairs().items(): - field_refs.append([referencingField, referencedField]) + fields_referenging.append(referencingField) + fields_referenced.append(referencedField) attrib.update({ 'fieldRef': { - 'referencingField': field_refs[0], - 'referencedField': field_refs[1] + 'referencingField': fields_referenging, + 'referencedField': fields_referenced } }) From 8c54088ba8c8a3bd83b17e18f2bee9505d394360 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Wed, 30 Aug 2023 16:14:32 +0200 Subject: [PATCH 04/15] Add case "graduatedSymbol" to getlegendgraphic filter. --- g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py b/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py index 1dadaec3b..bff39970b 100644 --- a/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py +++ b/g3w-admin/qdjango/server_filters/legend/getlegendgraphic.py @@ -72,7 +72,7 @@ def responseComplete(self): renderer = layer.renderer() - if renderer.type() in ("categorizedSymbol", "ruleBased", "graduatedSymbol"): + if renderer.type() in ("categorizedSymbol", "ruleBased", "graduatedSymbol","graduatedSymbol"): body = handler.body() json_data = json.loads(bytes(body)) categories = {item.label(): {'ruleKey': item.ruleKey(), 'checked': renderer.legendSymbolItemChecked( From df0b7afa57e558fb7e93390f49c8a5fad8743f2c Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Mon, 11 Sep 2023 12:47:34 +0200 Subject: [PATCH 05/15] Fix check is referenced fields ar primary key. --- g3w-admin/qdjango/vector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g3w-admin/qdjango/vector.py b/g3w-admin/qdjango/vector.py index 0b13496b9..9e47f9d30 100644 --- a/g3w-admin/qdjango/vector.py +++ b/g3w-admin/qdjango/vector.py @@ -144,7 +144,7 @@ def set_metadata_relations(self, request, **kwargs): # qgis_layer is the referenced layer qgis_layer = self.layer.qgis_layer referenced_field_is_pk = [qgis_layer.fields().indexFromName( - relation['fieldRef']['referencedField'])] == qgis_layer.primaryKeyAttributes() + rf) for rf in relation['fieldRef']['referencedField']] == qgis_layer.primaryKeyAttributes() # It's an old and buggy QGIS version so we cannot trust primaryKeyAttributes() and we go guessing if IS_QGIS_3_10: From 3544716d293f05a8094ff76d2c38b931878e8eaf Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Mon, 11 Sep 2023 13:31:22 +0200 Subject: [PATCH 06/15] Fix test. --- g3w-admin/qdjango/tests/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g3w-admin/qdjango/tests/test_utils.py b/g3w-admin/qdjango/tests/test_utils.py index 2038864c4..7cd8b594e 100644 --- a/g3w-admin/qdjango/tests/test_utils.py +++ b/g3w-admin/qdjango/tests/test_utils.py @@ -136,7 +136,7 @@ def test_qgis_project(self): # check layerRelations # ------------------------------------------ - layer_relations_to_check = '[{"referencingLayer": "cities10000eu20171228095720113", "strength": "Association", "referencedLayer": "countries_simpl20171228095706310", "name": "countries-citites", "id": "cities1000_ISO2_CODE_countries__ISOCODE", "fieldRef": {"referencingField": "ISO2_CODE", "referencedField": "ISOCODE"}}]' + layer_relations_to_check = '[{"referencingLayer": "cities10000eu20171228095720113", "strength": "Association", "referencedLayer": "countries_simpl20171228095706310", "name": "countries-citites", "id": "cities1000_ISO2_CODE_countries__ISOCODE", "fieldRef": {"referencingField": ["ISO2_CODE"], "referencedField": ["ISOCODE"]}}]' self.assertEqual(self.project.layerRelations, json.loads(layer_relations_to_check)) From d98d7699b93f73861511df8c80674ee6b7b8cba4 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Mon, 11 Sep 2023 15:40:45 +0200 Subject: [PATCH 07/15] Fix for editing with relations. --- g3w-admin/editing/api/base/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/g3w-admin/editing/api/base/views.py b/g3w-admin/editing/api/base/views.py index ee6397953..2fb47a45b 100644 --- a/g3w-admin/editing/api/base/views.py +++ b/g3w-admin/editing/api/base/views.py @@ -204,8 +204,9 @@ def save_vector_data(self, metadata_layer, post_layer_data, has_transactions, po # case relation data ADD, if father referenced field is pk if is_referenced_field_is_pk: for newid in kwargs['referenced_layer_insert_ids']: - if geojson_feature['properties'][metadata_layer.referencing_field] == newid['clientid']: - geojson_feature['properties'][metadata_layer.referencing_field] = newid['id'] + for referencing_field in metadata_layer.referencing_field: + if geojson_feature['properties'][referencing_field] == newid['clientid']: + geojson_feature['properties'][referencing_field] = newid['id'] if mode_editing == EDITING_POST_DATA_UPDATED: # control feature locked From 0753cbdd59e563b779371e2fcafb082b76346a9d Mon Sep 17 00:00:00 2001 From: volterra79 Date: Tue, 12 Sep 2023 15:20:22 +0200 Subject: [PATCH 08/15] :sparkles: Client: core: https://github.com/g3w-suite/g3w-client/pull/159 editing: https://github.com/g3w-suite/g3w-client-plugin-editing/pull/53 --- g3w-admin/client/static/client/js/app.min.js | 2 +- g3w-admin/editing/static/editing/js/plugin.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/g3w-admin/client/static/client/js/app.min.js b/g3w-admin/client/static/client/js/app.min.js index b95338952..a6b528c46 100644 --- a/g3w-admin/client/static/client/js/app.min.js +++ b/g3w-admin/client/static/client/js/app.min.js @@ -1,2 +1,2 @@ -!function n(r,a,o){function s(t,e){if(!a[t]){if(!r[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}i=a[t]={exports:{}},r[t][0].call(i.exports,function(e){return s(r[t][1][e]||e)},i,i.exports,n,r,a,o)}return a[t].exports}for(var l="function"==typeof require&&require,e=0;e=",lte:"<=",NOT:"!=",eq:"=",gt:">",lt:"<",IN:"IN","NOT IN":"NOT IN",LIKE:"LIKE",ILIKE:"ILIKE",AND:"AND",OR:"OR"}),n=i.FILTER_EXPRESSION_OPERATORS=n({lte:"<=",ltgt:"!=",ilike:"ILIKE",like:"LIKE"},o),s=i.GEOMETRY_FIELDS=["geometryProperty","boundedBy","geom","the_geom","geometry","bbox","GEOMETRY","geoemtria","geometria"],l=i.GEOMETRY_TYPES={POINT:"Point",POINTZ:"PointZ",POINTM:"PointM",POINTZM:"PointZM",POINT25D:"Point25D",MULTIPOINT:"MultiPoint",MULTIPOINTZ:"MultiPointZ",MULTIPOINTM:"MutliPointM",MULTIPOINTZM:"MultiPointZM",MULTIPOINT25D:"MultiPoint25D",LINESTRING:"LineString",LINESTRINGZ:"LineStringZ",LINESTRINGM:"LineStringM",LINESTRINGZM:"LineStringZM",LINESTRING25D:"LineString25D",LINE:"Line",LINEZ:"LineZ",LINEM:"LineM",LINEZM:"LineZM",LINE25D:"Line25D",MULTILINESTRING:"MultiLineString",MULTILINESTRINGZ:"MultiLineStringZ",MULTILINESTRINGM:"MultiLineStringM",MULTILINESTRINGZM:"MultiLineStringZM",MULTILINESTRING25D:"MultiLineString25D",MULTILINE:"MultiLine",MULTILINEZ:"MultiLineZ",MULTILINEM:"MultiLineM",MULTILINEZM:"MultiLineZM",MULTILINE25D:"MultiLine25D",POLYGON:"Polygon",POLYGONZ:"PolygonZ",POLYGONM:"PolygonM",POLYGONZM:"PolygonZM",POLYGON25D:"Polygon25D",MULTIPOLYGON:"MultiPolygon",MULTIPOLYGONZ:"MultiPolygonZ",MULTIPOLYGONM:"MultiPolygonM",MULTIPOLYGONZM:"MultiPolygonZM",MULTIPOLYGON25D:"MultiPolygon25D",GEOMETRYCOLLECTION:"GeometryCollection",GEOMETRYCOLLECTIONZ:"GeometryCollectionZ",GEOMETRYCOLLECTIONM:"GeometryCollectionM",GEOMETRYCOLLECTIONZM:"GeometryCollectionZM",GEOMETRYCOLLECTION25D:"GeometryCollection25D"},u=(i.LIST_OF_RELATIONS_TITLE="info.list_of_relations",i.LIST_OF_RELATIONS_ID="__G3W_LIST_OF_RELATIONS_ID__",i.LOCALSTORAGE_EXTERNALWMS_ITEM="externalwms",i.MAP_SETTINGS={ZOOM:{maxScale:1e3},ANIMATION:{duration:2e3},LAYER_POSITIONS:{default:"top",getPositions:function(){return["top","bottom"]}}}),c=i.PRINT_FORMATS=[{value:"pdf",label:"PDF"},{value:"png",label:"PNG"}],d=i.PRINT_RESOLUTIONS=[150,300],p=i.PRINT_SCALES=[{value:100,label:"1:100"},{value:200,label:"1:200"},{value:500,label:"1:500"},{value:1e3,label:"1:1.000"},{value:2e3,label:"1:2.000"},{value:2500,label:"1:2.500"},{value:5e3,label:"1:5.000"},{value:1e4,label:"1:10.000"},{value:2e4,label:"1:20.000"},{value:25e3,label:"1:25.000"},{value:5e4,label:"1:50.000"},{value:1e5,label:"1:100.000"},{value:25e4,label:"1:250.000"},{value:5e5,label:"1:500.000"},{value:1e6,label:"1:1.000.000"},{value:25e5,label:"1:2.500.000"},{value:5e6,label:"1:5.000.000"},{value:1e7,label:"1:10.000.000"},{value:2e7,label:"1:20.000.000"},{value:5e7,label:"1:50.000.000"},{value:1e8,label:"1:100.000.000"},{value:25e7,label:"1:250.000.000"},{value:5e8,label:"1:500.000.000"}],f=i.QUERY_POINT_TOLERANCE={unit:"pixel",value:10},h=(i.SEARCH_ALLVALUE="__G3W_ALL__",i.SEARCH_RETURN_TYPES=["data","search"]),g=(i.TIMEOUT=6e4,i.TOC_LAYERS_INIT_STATUS="not_collapsed",i.TOC_THEMES_INIT_STATUS="collapsed",i.VIEWPORT={resize:{map:{min:200},content:{min:200}}}),v=i.ZINDEXES={usermessage:{tool:2}},m=i.API_BASE_URLS={ABOUT:{macrogroups:"/about/api/macrogroup/",nomacrogoups:"/about/api/group/nomacrogroup/",projects:"/about/api/group/__G3W_GROUP_ID__/projects/",group:"/about/api/group/"},CRS:"/crs/"},y=i.FONT_AWESOME_ICONS={"change-map":"fas fa-map-signs",map:"far fa-map",file:"fas fa-file-code",marker:"fas fa-map-marker-alt",relation:"fas fa-sitemap",tools:"fas fa-cogs",tool:"fas fa-cog",search:"fas fa-search",print:"fas fa-print",info:"fas fa-info-circle","info-circle":"fas fa-info-circle",globe:"fas fa-globe",mail:"fas fa-envelope",mobile:"fas fa-mobile",fax:"fas fa-fax",user:"fas fa-user",bars:"fas fa-bars",uncheck:"far fa-square",check:"far fa-check-square",filluncheck:"fas fa-square",table:"fas fa-table",trash:"fas fa-trash","trash-o":"far fa-trash-alt",pencil:"fas fa-pencil-alt","ellips-h":"fas fa-ellipsis-h","ellips-v":"fas fa-ellipsis-v","arrow-up":"fas fa-chevron-up","arrow-down":"fas fa-chevron-down","arrow-left":"fas fa-chevron-left","arrow-right":"fas fa-chevron-right","resize-h":"fas fa-arrows-alt-h","resize-v":"fas fa-arrows-alt-v","resize-default":"fas fa-compress","caret-up":"fas fa-caret-up","caret-down":"fas fa-caret-down","caret-left":"fas fa-caret-left","caret-right":"fas fa-caret-right","empty-circle":"far fa-circle","cloud-upload":"fas fa-cloud-upload-alt",spinner:"fas fa-spinner",minus:"fas fa-minus","minus-square":"far fa-minus-square",plus:"fas fa-plus","plus-circle":"fas fa-plus-circle","plus-square":"far fa-plus-square",grid:"fas fa-th",home:"fas fa-home",folder:"fas fa-folder","sign-out":"fas fa-sign-out-alt",close:"fas fa-times",time:"far fa-clock",calendar:"fas fa-calendar-alt",list:"fas fa-list-alt",link:"fas fa-link",unlink:"fas fa-unlink",eye:"far fa-eye","eye-close":"far fa-eye-slash",save:"far fa-save",pdf:"fas fa-file-pdf",image:"far fa-image",video:"far fa-file-video",unknow:"far fa-question-circle",zip:"far fa-file-archive",text:"far fa-file-alt",excel:"far fa-file-excel",xls:"far fa-file-excel",gpx:"fas fa-location-arrow",gpkg:"fas fa-box-open",shapefile:"fas fa-file-archive",csv:"fas fa-file-csv",geotiff:"fas fa-th",ppt:"far fa-file-powerpoint",circle:"fas fa-circle",calculator:"fas fa-calculator",picture:"far fa-image",keyboard:"far fa-keyboard","file-download":"fas fa-file-download",copy:"far fa-copy",draw:"fas fa-draw-polygon",chart:"fas fa-chart-bar","chart-line":"fas fa-chart-line","chart-area":"fas fa-chart-area","chart-pie":"fas fa-chart-pie",run:"fas fa-play",warning:"fas fa-exclamation-circle",alert:"fas fa-exclamation-triangle",crosshairs:"fas fa-crosshairs",success:"far fa-check-circle",back:"fas fa-chevron-circle-left","file-upload":"fas fa-file-upload",wifi:"fas fa-wifi",mouse:"fas fa-mouse","copy-paste":"far fa-copy","vector-square":"fas fa-vector-square",download:"fas fa-download",credits:"fas fa-euro-sign",filter:"fas fa-filter",plugin:"fas fa-plug",invert:"fas fa-exchange-alt",clear:"fas fa-broom",palette:"fas fa-palette",layers:"fas fa-layer-group","sign-in":"fas fa-sign-in-alt",language:"fas fa-language",target:"fas fa-bullseye",pin:"fas fa-map-pin",square:"far fa-square",move:"fas fa-arrows-alt",moon:"fas fa-moon",sun:"fas fa-sun",refresh:"fas fa-sync-alt",pause:"fas fa-pause","step-backward":"fas fa-step-backward","fast-backward":"fas fa-fast-backward","step-forward":"fas fa-step-forward","fast-forward":"fas fa-fast-forward",crop:"fas fa-crop-alt",exit:"fas fa-door-open",slider:"fas fa-sliders-h",bookmark:"fas fa-bookmark",reply:"fas fa-reply",share:"fas fa-share"},_=i.LOCAL_ITEM_IDS={MESSAGES:{id:"MESSAGES",value:{}},SPATIALBOOKMARKS:{id:"SPATIALBOOKMARKS",value:{}}},b=(i.LOGO_GIS3W="images/logo_gis3w_156_85.png",i.SPATIAL_METHODS=["intersects","within"]);i.default={APP_VERSION:e,API_BASE_URLS:m,DEFAULT_EDITING_CAPABILITIES:r,DOWNLOAD_FORMATS:a,FILTER_OPERATORS:o,FILTER_EXPRESSION_OPERATORS:n,FONT_AWESOME_ICONS:y,G3W_FID:"g3w_fid",GEOMETRY_FIELDS:s,GEOMETRY_TYPES:l,LIST_OF_RELATIONS_TITLE:"info.list_of_relations",LIST_OF_RELATIONS_ID:"__G3W_LIST_OF_RELATIONS_ID__",LOCAL_ITEM_IDS:_,LOCALSTORAGE_EXTERNALWMS_ITEM:"externalwms",LOGO_GIS3W:"images/logo_gis3w_156_85.png",MAP_SETTINGS:u,PRINT_FORMATS:c,PRINT_RESOLUTIONS:d,PRINT_SCALES:p,QUERY_POINT_TOLERANCE:f,SEARCH_ALLVALUE:"__G3W_ALL__",SEARCH_RETURN_TYPES:h,SPATIAL_METHODS:b,TIMEOUT:6e4,TOC_LAYERS_INIT_STATUS:"not_collapsed",TOC_THEMES_INIT_STATUS:"collapsed",VIEWPORT:g,ZINDEXES:v}},{"../version":360}],5:[function(e,t,i){var n=a(e("store/projects")),r=a(e("services/gui"));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return function(){var s=e.apply(this,arguments);return new Promise(function(a,o){return function t(e,i){try{var n=s[e](i),r=n.value}catch(e){return void o(e)}if(!n.done)return Promise.resolve(r).then(function(e){t("next",e)},function(e){t("throw",e)});a(r)}("next")})}}var s=e("core/utils/utils").resolve;function l(){var t=this;n.default.onbefore("setCurrentProject",function(e){return t.project=e}),this.project=n.default.getCurrentProject()}var u,e=l.prototype;e.handleRequest=function(e){},e.handleResponse=(u=o(function*(e){}),function(e){return u.apply(this,arguments)}),e.getSelectedExternalLayers=function(e){e=e.type,e=void 0===e?"vector":e;return r.default.getService("catalog").getExternalSelectedLayers({type:e})},e.getEmptyRequest=function(){return s([])},e.hasExternalLayerSelected=function(e){e=e.type;return 0t){i=n;break}r.id===t&&(i=-1);break}-1e,this.state.undo},r.canRedo=function(){return this.state.redo=this.getLastState()&&this.getLastState().id!=this._current||_.isNull(this._current)&&0=this.state.maxscale&&e<=this.state.minscale)},e.getStyles=function(){return(this.config.source.external?this.config.source:this.config).styles},e.getStyle=function(){return this.config.source.external?this.config.source.styles:this.config.styles?this.config.styles.find(function(e){return e.current}).name:""},e.getOpacity=function(){return this.state.opacity},e.setCurrentStyle=function(t){var i=!1;return this.config.styles.forEach(function(e){e.name===t&&(i=!e.current),e.current=e.name===t}),i},e.getCurrentStyle=function(){return this.config.styles.find(function(e){return e.current})},e.setDisabled=function(e){if(this.state.scalebasedvisibility){for(var t=s(e,1=this.state.maxscale&&t<=this.state.minscale),this.state.disabled=0===this.state.minscale?!(t>=this.state.maxscale):this.state.disabled,!0),n=this.state.parentGroup;n;)i=i&&n.checked,n=n.parentGroup;i&&this.setVisible(!this.state.disabled),this.isFilterable()&&this.setTocHighlightable(!this.state.disabled)}else this.state.disabled=!1},e.getMultiLayerId=function(){return this.config.multilayerid},e.getGeometryType=function(){return this.config.geometrytype},e.getOwsMethod=function(){return this.config.ows_method},e.setProjection=function(){this.config.projection=o.get(0\n \n ',data:function(){return{errorrows:_}}}},autoclose:!1}),d=new ol.layer.Vector({source:new ol.source.Vector({features:y}),name:a,_fields:f,id:S()}),u&&d.setStyle(u);break;case"kmz":p=new Promise((n=x(function*(e,t){var i=new JSZip,n=yield l.arrayBuffer(l),n=(i.load(n),i.file(/.kml$/i)),i=n[n.length-1];i?(l=i.asText(),e(r(new ol.format.KML({extractStyles:!1}),l,"EPSG:4326"))):t()}),function(e,t){return n.apply(this,arguments)}));try{return yield p}catch(e){return Promise.reject()}break;case"zip":p=new Promise((i=x(function*(t,i){var e=yield l.arrayBuffer(l);shp(e).then(function(e){e=JSON.stringify(e);c=new ol.format.GeoJSON({}),t(r(c,e,"EPSG:4326"))}).catch(function(e){return i(e)})}),function(e,t){return i.apply(this,arguments)}));try{return yield p}catch(e){return Promise.reject()}}return d}),function(){return u.apply(this,arguments)}),createStyleFunctionToVectorLayer:function(){function e(e,t){var i=a.color,n=a.field,i=i.rgba?"rgba("+i.rgba.r+","+i.rgba.g+","+i.rgba.b+","+i.rgba.a+")":i,r=e.getGeometry().getType(),r=m.getDefaultLayerStyle(r,{color:i});return n&&r.setText(new ol.style.Text({text:""+e.get(n),font:"bold",scale:2,offsetY:15,fill:new ol.style.Fill({color:i}),stroke:new ol.style.Stroke({color:"#FFFFFF",width:2})})),r}var a=0\n
\n \n \n
\n
\n \n \n
\n '}},title:"Scelgli il tipo di operazione"};n.default.showUserMessage({type:"tool",message:e.message,size:e.size||"small",title:e.title||"",hooks:e.hooks})}}},{"services/gui":340}],47:[function(s,e,t){var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var i=t,n=[],r=!0,t=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!i||n.length!==i);r=!0);}catch(e){t=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(t)throw a}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=Object.assign||function(e){for(var t=1;t"),i="nautical"===t?this.transformMeterArea(r,t)+"  nmi²":1e62":(Math.round(100*r)/100).toFixed(3)+" m2",i=a?"Area: "+i+'
'+a:i},formatMeasure:function(){var t,e=0>2,r=(3&t)<<4|(t=e.charCodeAt(l++))>>4,o=(15&t)<<2|(i=e.charCodeAt(l++))>>6,s=63&i,isNaN(t)?o=s=64:isNaN(i)&&(s=64),a=a+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(o)+this._keyStr.charAt(s);return a},decode:function(e){var t,i,n,r,a,o,s="",l=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");l>2,i=(3&a)<<6|(o=this._keyStr.indexOf(e.charAt(l++))),s+=String.fromCharCode(n<<2|r>>4),64!=a&&(s+=String.fromCharCode(t)),64!=o&&(s+=String.fromCharCode(i));return s=f._utf8_decode(s)},_utf8_encode:function(e){e=e.replace(/rn/g,"n");for(var t="",i=0;i>6|192))+String.fromCharCode(63&n|128):(t=(t+=String.fromCharCode(n>>12|224))+String.fromCharCode(n>>6&63|128))+String.fromCharCode(63&n|128)}return t},_utf8_decode:function(e){var t,i="",n=0;for(c1=c2=0;n",">")).replace('"',""")},fileDownload:function(){var n,e=0t&&(e=$(this).position().left,i>$(this).outerWidth()&&(t+=i-$(this).outerWidth()),$(this).css("left",t+"px"),t=e,i=$(this).outerWidth())}),$(this.element).hide()},n.setEnable=function(e){$(this.element).find("button").first().toggleClass("g3w-ol-disabled",!e),!e&&this._interaction&&this._interaction.setActive(!1),this._enabled=e},n.getEnable=function(){return this._enabled},n.setVisible=function(){var e=!(0/g,">").replace(/"/g,""").replace(/'/g,"'")},createElement:function(e,t){var i=void 0;if(Array.isArray(e)){if(i=document.createElement(e[0]),e[1].id&&(i.id=e[1].id),e[1].classname&&(i.className=e[1].classname),e[1].attr){var n=e[1].attr;if(Array.isArray(n))for(var r=-1;++r=i.options.autoCompleteMinLength&&i.query(t)},200))},!1),this.reset.addEventListener("click",function(){i.input.focus(),i.input.value="",i.lastQuery="",b.addClass(i.reset,_.hidden),i.clearResults()},!1)},this.query=function(c){var i,d=this;return this.hideMarker(),new Promise((i=f(function*(e,t){function i(e){return"Number"===v(e)&&!Number.isNaN(e)}var n,r,a=null,o=!1;if(c){var s=c.split(","),s=p(s,3),l=s[0],u=s[1],s=s[2],a=i(+l)&&i(+u)?[+l,+u]:null;try{s&&y.get("EPSG:"+s.trim())&&(a=ol.proj.transform(a,y.get("EPSG:"+s.trim()),"EPSG:4326"),o=!0)}catch(e){}}a?(d.showMarker(a,{transform:o}),e(a)):d.lastQuery===c&&d.result.firstChild||(n=[],(r=d.providers.filter(function(e){return e.active})).forEach(function(e){var e=e.getParameters({query:c,lang:d.options.lang,countrycodes:d.options.countrycodes,limit:d.options.limit}),t=e.url,e=e.params;d.lastQuery=c,d.clearResults(),b.addClass(d.reset,_.spin),n.push(m.get({url:t,params:e}))}),(yield Promise.allSettled(n)).forEach(function(e,t){var i=e.status,e=e.value;"fulfilled"===i&&(e=(i=r[t].handleResponse(e)).header,i=i.results,r[t].active)&&d.createList({header:e,results:i})}),b.removeClass(d.reset,_.spin))}),function(e,t){return i.apply(this,arguments)}))},this.createList=function(){var n=this,e=0',i,""].join(""),e=b.createElement("li",e);e.addEventListener("click",function(e){e.preventDefault(),n.chosen(t,i,t.address,t.original)},!1),r.appendChild(e)}):(t=(new(Vue.extend((0,u.default)({noresults:this.options.noresults})))).$mount().$el,r.appendChild(t))},this.chosen=function(e,t,i,n){e=[parseFloat(e.lon),parseFloat(e.lat)];!1===this.options.keepOpen&&this.clearResults(!0),this.showMarker(e)},this.createHeaderProviderResults=function(){var e='\n
\n '+(0\n
",e=b.createElement("li",e);return e.classList.add("skin-background-color"),e},this.addressTemplate=function(e){var t=[];return e.name&&t.push(['
{name}
'].join("")),(e.road||e.building||e.house_number)&&t.push(['
{building} {road} {house_number}
'].join("")),(e.city||e.town||e.village)&&t.push(['
{postcode} {city} {town} {village}
'].join("")),(e.state||e.country)&&t.push(['
{state} {country}
'].join("")),b.template(t.join("
"),e)},this.expand=function(){var e=this;b.removeClass(this.input,_.spin),b.addClass(this.control,_.glass.expanded),setTimeout(function(){return e.input.focus()},100)},this.collapse=function(){this.input.value="",this.input.blur(),b.addClass(this.reset,_.hidden),this.clearResults()},this.clearResults=function(){b.removeAllChildren(this.result),this.hideMarker()},this.getSource=function(){return this.layer.getSource()},this.addLayer=function(){var t=this,e=this.getMap();e.getLayers().find(function(e){return e===t.layer})||e.addLayer(this.layer)},this.createControl(),h.call(this,{element:this.container,name:"nominatim",offline:!1})}ol.inherits(C,h),t.exports=C},{"./control":60,"components/MapControlGeocoding":232,"components/MapControlNominatimResults":233,"core/utils/utils":49,"g3w-ol/projection/projections":90,"services/gui":340,"store/application-state":352}],62:[function(e,t,i){var a=e("g3w-ol/controls/interactioncontrol");function n(){this._layer=new ol.layer.Vector({source:new ol.source.Vector,style:new ol.style.Style({text:new ol.style.Text({offsetY:-15,text:"",font:'900 3em "Font Awesome 5 Free"',fill:new ol.style.Fill({color:"red"})})})}),a.call(this,{visible:!1,offline:!1,name:"geolocation",tipLabel:"sdk.mapcontrols.geolocation.tooltip",label:""})}ol.inherits(n,a);e=n.prototype;e._showMarker=function(e){var t=e.map,i=e.coordinates,e=e.show,e=void 0===e||e;this._layer&&(this._layer.getSource().clear(),e?(t.getView().setCenter(i),e=new ol.Feature({geometry:new ol.geom.Point(i)}),this._layer.getSource().addFeature(e),t.addLayer(this._layer)):t.removeLayer(this._layer))},e.getMap=function(){return a.prototype.getMap.call(this)},e.setMap=function(t){var i=this,n=void 0,r=(a.prototype.setMap.call(this,t),new ol.Geolocation({projection:t.getView().getProjection(),tracking:!0,trackingOptions:{enableHighAccuracy:!0}}));r.on("change:position",function(){var e=r.getPosition();e?(i.isVisible()||(i.setVisible(!0),$(i.element).removeClass("g3w-ol-disabled"),r.dispatchEvent("authorized")),i._showMarker({map:t,coordinates:e,show:i.isToggled()})):i.hideControl()}),r.once("error",function(e){i.hideControl(),i._layer=null,1!==e.code&&i.dispatchEvent("error"),ol.Observable.unByKey(n),n=null}),r.once("authorized",function(){n=i.on("toggled",function(){var e=r.getPosition();i._showMarker({map:t,coordinates:e,show:i.isToggled()})})})},t.exports=n},{"g3w-ol/controls/interactioncontrol":64}],63:[function(e,t,i){var n=Object.assign||function(e){for(var t=1;t\n \n ',watch:{method:function(e){return t.setSpatialMethod(e)}},created:function(){o.default.setCloseUserMessageBeforeSetContent(!1)},beforeDestroy:function(){o.default.setCloseUserMessageBeforeSetContent(!0)}};break;case"custom":this.toggledTool=n}"hover"===e&&this._createToolOnHoverButton()},e._createToolOnHoverButton=function(){var t=this;this._onhover&&(this._toolButton=$(''),$(this.element).prepend(this._toolButton),this._toolButton.on("click",function(e){e.stopPropagation(),t.showToggledTool(!0)}),$(this.element).hover(function(){return t._toggled&&t._toolButton.show()}),$(this.element).mouseleave(function(){return t._toolButton.hide()}))},e.showToggledTool=function(){!(0