Skip to content

Update LineOfSightWidgetFactory that the analysis stops properly; upd… #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 14 additions & 64 deletions src/main/js/apps/sample/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class LineOfSightWidgetFactory {
deactivate() {
this._deactivateBinding();
this._destroyWidget();
this.#lineOfSightWidget.viewModel.stop();
}

createInstance() {
Expand All @@ -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() {
Expand Down
18 changes: 13 additions & 5 deletions src/main/js/bundles/dn_lineofsight/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -86,7 +86,8 @@
"name": "Config",
"impl": "./LineOfSightWidgetFactory",
"provides": [
"dijit.Widget"
"dijit.Widget",
"dn_lineofsight.Widget"
],
"instanceFactory": true,
"properties": {
Expand Down Expand Up @@ -117,8 +118,15 @@
"rules": {
"viewmode": "3D",
"ruleSuccessProperty": "visibility"
},
"deactivateHandler": "deactivateWidget"
},
"references": [
{
"name": "handlerScope",
"providing": "dn_lineofsight.Widget"
}
}
]
}
]
}
Loading