diff --git a/src/main/js/apps/sample/app.json b/src/main/js/apps/sample/app.json index a5d56a8..df593e8 100644 --- a/src/main/js/apps/sample/app.json +++ b/src/main/js/apps/sample/app.json @@ -56,83 +56,33 @@ "map": { "layers": [ { - "id": "zuerich3d", - "title": "Edge-Rendering", - "url": "https://tiles.arcgis.com/tiles/oPre3pOfRfefL8y0/arcgis/rest/services/LOD2_GEBAEUDE_ZRH/SceneServer", + "id": "buildings", "type": "AGS_SCENE", - "popupTemplate": { - "title": "{expression/typ}", - "content": [ - { - "type": "fields", - "fieldInfos": [ - { - "fieldName": "expression/quality" - }, - { - "fieldName": "EGID", - "label": "Eidgenössischer Gebäudeidentifikator" - } - ] - } - ], - "expressionInfos": [ - { - "name": "typ", - "expression": "When($feature.ART == 'BB00', 'Verwaltung', $feature.ART == 'BB01', 'Wohngebäude', $feature.ART == 'BB02', 'Land & Forstwirtschaft',$feature.ART == 'BB03', 'Verkehr',$feature.ART == 'BB04', 'Handel',$feature.ART == 'BB05', 'Industrie & Gewerbe',$feature.ART == 'BB06', 'Gastgewerbe',$feature.ART == 'BB07', 'Nebengebäude',$feature.ART == 'EO08', 'Brücke/Passerelle',$feature.ART == 'EO12', 'Pfeiler',$feature.ART == 'EO13', 'Unterstand',$feature.ART == 'EO14', 'Silo/Turm/Gasometer',$feature.ART == 'EO16', 'Hochkamin',$feature.ART == 'EO18', 'Mast/Antenne', 'n/a')" - }, - { - "name": "quality", - "title": "Qualität", - "expression": "When($feature.QUALITAET_STATUS == 0, 'Qualität nicht eingehalten -> Gebäudehöhe wurde nicht gemessen -> die Baute hat eine generische Höhe von 3m', $feature.QUALITAET_STATUS == 1, 'normale Kontrolle -> Gebäudehöhen sind photogrammetrisch bestimmt', $feature.QUALITAET_STATUS == 2, 'spezielle Kontrolle -> Gebäudehöhen sind photogrammetrisch bestimmt und speziell kontrolliert', 'n/a')" - } - ] - }, - "renderer": { - "type": "simple", - "symbol": { - "type": "mesh-3d", - "symbolLayers": [ - { - "type": "fill", - "material": { - "color": "#ffffff", - "colorMixMode": "replace" - }, - "edges": { - "type": "solid", - "color": [ - 50, - 50, - 50, - 0.5 - ], - "size": 1 - } - } - ] - } - } + "url": "https://services2.arcgis.com/cFEFS0EWrhfDeVw9/arcgis/rest/services/STM____FR_Lyon__Textured_buildings/SceneServer" } ], "ground": [ { - "url": "https://scene.arcgis.com/arcgis/rest/services/Zurich_DTM/ImageServer", - "type": "AGS_ELEVATION" + "url": "https://tiles.arcgis.com/tiles/cFEFS0EWrhfDeVw9/arcgis/rest/services/ELEV____FR_Lyon__Elevation/ImageServer", + "type": "ELEVATION" + }, + { + "url": "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", + "type": "ELEVATION" } ] }, "view": { "viewmode": "3D", "camera": { - "heading": 338.4613139877434, - "tilt": 65.6626297158947, + "heading": 136.870179464322, + "tilt": 79.7964462504739, "position": { - "x": 951163.1908125386, - "y": 6002664.875400205, - "z": 793.7736872918904, + "x": 536508.428229189, + "y": 5742784.27106477, + "z": 365.899003159255, "spatialReference": { - "wkid": 102100 + "wkid": 3857 } } } diff --git a/src/main/js/bundles/dn_lineofsight/LineOfSightWidgetFactory.js b/src/main/js/bundles/dn_lineofsight/LineOfSightWidgetFactory.js index 7746169..e431580 100644 --- a/src/main/js/bundles/dn_lineofsight/LineOfSightWidgetFactory.js +++ b/src/main/js/bundles/dn_lineofsight/LineOfSightWidgetFactory.js @@ -25,6 +25,7 @@ export default class LineOfSightWidgetFactory { deactivate() { this._deactivateBinding(); this._destroyWidget(); + this.#lineOfSightWidget.viewModel.stop(); } createInstance() { @@ -39,9 +40,13 @@ export default class LineOfSightWidgetFactory { .enable() .syncToLeftNow(); - lineOfSightWidget.own(binding); + const widget = new EsriDijit(lineOfSightWidget); - return new EsriDijit(lineOfSightWidget); + widget.deactivateWidget = function () { + lineOfSightWidget.viewModel.stop(); + }; + widget.own(binding); + return widget; } _destroyWidget() { diff --git a/src/main/js/bundles/dn_lineofsight/manifest.json b/src/main/js/bundles/dn_lineofsight/manifest.json index 34e9750..262a8cd 100644 --- a/src/main/js/bundles/dn_lineofsight/manifest.json +++ b/src/main/js/bundles/dn_lineofsight/manifest.json @@ -37,15 +37,15 @@ "resizable": true, "marginBox": { "w": 350, - "h": 214, + "h": 220, "l": 20, "t": 125 }, "minSize": { "w": 350, - "h": 214 + "h": 220 }, - "windowClass": "dn_lineofsight__window noPadding" + "windowClass": "dn_lineofsight__window" } }, { @@ -86,7 +86,8 @@ "name": "Config", "impl": "./LineOfSightWidgetFactory", "provides": [ - "dijit.Widget" + "dijit.Widget", + "dn_lineofsight.Widget" ], "instanceFactory": true, "properties": { @@ -117,8 +118,15 @@ "rules": { "viewmode": "3D", "ruleSuccessProperty": "visibility" + }, + "deactivateHandler": "deactivateWidget" + }, + "references": [ + { + "name": "handlerScope", + "providing": "dn_lineofsight.Widget" } - } + ] } ] }