diff --git a/pom.xml b/pom.xml index 938db53..88f4707 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,13 @@ pom test + + + + de.conterra.devnet + mapapps-selection-actions + 1.14.0 + @@ -431,7 +438,8 @@ deployAppTemplate - ${project.build.directory}/${project.artifactId}-sample-app.zip + + ${project.build.directory}/${project.artifactId}-sample-app.zip ${js.build.outputPath}/apps/sample diff --git a/src/main/js/apps/sample_selectionactions/app.json b/src/main/js/apps/sample_selectionactions/app.json index 1de0e87..49815f4 100644 --- a/src/main/js/apps/sample_selectionactions/app.json +++ b/src/main/js/apps/sample_selectionactions/app.json @@ -321,6 +321,51 @@ } ] }, + "dn_selectionactions": { + "CircleSpatialInputWidgetModel": { + "enableDonut": true, + "minRadius": 0, + "maxRadius": 500, + "innerRadius": 0, + "outerRadius": 100, + "stepSize": 1, + "adjustStepSize": true, + "stepSizeRanges": [ + { + "scaleRange": [ + 1, + 100000 + ], + "stepSize": 1 + }, + { + "scaleRange": [ + 100000, + 100000000 + ], + "stepSize": 100 + } + ], + "unit": "meters" + }, + "AreaSelectSpatialInputWidgetModel": { + "buffer": 0, + "minBuffer": 0, + "maxBuffer": 5000, + "stepSize": 100, + "unit": "meters" + }, + "GraphicSpatialInputWidgetModel": { + "buffer": 0, + "minBuffer": 0, + "maxBuffer": 5000, + "stepSize": 100, + "unit": "meters" + }, + "MultiPointSpatialInputAction": { + "clickTolerance": 5 + } + }, "banner": { "BannerWidget": { "label": "Developer Network", @@ -362,7 +407,9 @@ "agssearch": { "AutoStoreRegistration": { "componentEnabled": true, - "useIn": ["querybuilder"] + "useIn": [ + "querybuilder" + ] }, "AGSStore": [ { @@ -483,6 +530,38 @@ "useIn": [ "querybuilder" ] + }, + { + "id": "kreise", + "layerId": "kreise", + "title": "Kreise", + "description": "Kreise", + "fetchIdProperty": true, + "filterOptions": { + "suggestContains": true + }, + "useIn": [ + "search", + "selection", + "selection-actions-area" + ], + "priority": 2, + "searchLabel": "kreis_name", + "searchAttribute": "kreis_name" + }, + { + "id": "bundeslaender", + "url": "https://services.conterra.de/arcgis/rest/services/common/grenzen/FeatureServer/2", + "title": "Bundesländer", + "description": "Bundesländer", + "fetchIdProperty": true, + "filterOptions": { + "suggestContains": true + }, + "priority": 1, + "useIn": [ + "selection-actions-area" + ] } ] }, diff --git a/src/main/js/bundles/dn_querybuilder/QueryBuilderWidgetModel.js b/src/main/js/bundles/dn_querybuilder/QueryBuilderWidgetModel.js index 85c653f..757dc6c 100644 --- a/src/main/js/bundles/dn_querybuilder/QueryBuilderWidgetModel.js +++ b/src/main/js/bundles/dn_querybuilder/QueryBuilderWidgetModel.js @@ -28,6 +28,7 @@ import ProjectParameters from "esri/rest/support/ProjectParameters"; const _replaceOpenedTablesBinding = Symbol("_spatialInputActionServiceBinding"); const _spatialInputActionServiceBinding = Symbol("_spatialInputActionServiceBinding"); const _spatialInputActionPromise = Symbol("_spatialInputActionPromise"); +const _oldSpatialInputActionId = Symbol("_oldSpatialInputActionId"); export default declare({ @@ -82,48 +83,48 @@ export default declare({ metadataDelay: 500, operators: {}, defaultOperators: { - default : { + default: { codedvalue: [ - {value: "$eq", text: "is"}, - {value: "!$eq", text: "is_not"}, - {value: "$gt", text: "is_greater_than"}, - {value: "$gte", text: "is_greater_or_equal"}, - {value: "$lt", text: "is_less_than"}, - {value: "$lte", text: "is_less_or_equal"}, - {value: "$exists", text: "exists"} + { value: "$eq", text: "is" }, + { value: "!$eq", text: "is_not" }, + { value: "$gt", text: "is_greater_than" }, + { value: "$gte", text: "is_greater_or_equal" }, + { value: "$lt", text: "is_less_than" }, + { value: "$lte", text: "is_less_or_equal" }, + { value: "$exists", text: "exists" } ], boolean: [ - {value: "$eq", text: "is"}, - {value: "!$eq", text: "is_not"}, - {value: "$exists", text: "exists"} + { value: "$eq", text: "is" }, + { value: "!$eq", text: "is_not" }, + { value: "$exists", text: "exists" } ], string: [ - {value: "$eq", text: "is"}, - {value: "!$eq", text: "is_not"}, - {value: "$eqw", text: "eqw"}, - {value: "$suggest", text: "suggest"}, - {value: "$exists", text: "exists"}, - {value: "$in", text: "in"} + { value: "$eq", text: "is" }, + { value: "!$eq", text: "is_not" }, + { value: "$eqw", text: "eqw" }, + { value: "$suggest", text: "suggest" }, + { value: "$exists", text: "exists" }, + { value: "$in", text: "in" } ], - number: [ - {value: "$eq", text: "is"}, - {value: "!$eq", text: "is_not"}, - {value: "$gt", text: "is_greater_than"}, - {value: "$gte", text: "is_greater_or_equal"}, - {value: "$lt", text: "is_less_than"}, - {value: "$lte", text: "is_less_or_equal"}, - {value: "$exists", text: "exists"}, - {value: "$in", text: "in"} + number: [ + { value: "$eq", text: "is" }, + { value: "!$eq", text: "is_not" }, + { value: "$gt", text: "is_greater_than" }, + { value: "$gte", text: "is_greater_or_equal" }, + { value: "$lt", text: "is_less_than" }, + { value: "$lte", text: "is_less_or_equal" }, + { value: "$exists", text: "exists" }, + { value: "$in", text: "in" } ], date: [ - {value: "$lte", text: "before"}, - {value: "$gte", text: "after"}, - {value: "$exists", text: "exists"} + { value: "$lte", text: "before" }, + { value: "$gte", text: "after" }, + { value: "$exists", text: "exists" } ], default: [ - {value: "$eq", text: "is"}, - {value: "!$eq", text: "is_not"}, - {value: "$exists", text: "exists"} + { value: "$eq", text: "is" }, + { value: "!$eq", text: "is_not" }, + { value: "$exists", text: "exists" } ] } }, @@ -206,17 +207,25 @@ export default declare({ selectSpatialInputAction(id) { const spatialInputActionService = this._spatialInputActionService; - const oldSpatialInputAction = this[_spatialInputActionPromise]; - if (oldSpatialInputAction) { - oldSpatialInputAction.cancel(); + const oldSpatialInputActionPromise = this[_spatialInputActionPromise]; + const oldSpatialInputActionId = this[_oldSpatialInputActionId]; + if (oldSpatialInputActionPromise) { + oldSpatialInputActionPromise.cancel(); this[_spatialInputActionPromise] = null; } + if (oldSpatialInputActionId) { + const oldSpatialInputAction = spatialInputActionService.getById(oldSpatialInputActionId); + oldSpatialInputAction.disable?.(); + this[_oldSpatialInputActionId] = null; + } if (!id) { this.activeSpatialInputAction = null; this.activeSpatialInputActionDescription = null; return; } + this[_oldSpatialInputActionId] = id; const spatialInputAction = spatialInputActionService.getById(id); + spatialInputAction.enable?.(); const promise = this[_spatialInputActionPromise] = spatialInputAction.trigger({ queryBuilderSelection: true }); promise.then((geometry) => { this.activeSpatialInputAction = null; @@ -640,10 +649,10 @@ export default declare({ return; }, - prepareOperators(operators){ - const completeOperators = {...this.defaultOperators}; + prepareOperators(operators) { + const completeOperators = { ...this.defaultOperators }; Object.keys(operators).forEach(configuration => { - completeOperators[configuration] = {...this.defaultOperators.default}; + completeOperators[configuration] = { ...this.defaultOperators.default }; Object.keys(operators[configuration]).forEach(type => { completeOperators[configuration][type] = operators[configuration][type]; });