@@ -7,6 +7,7 @@ import './tracking3d-element';
77
88import Basemap from '@arcgis/core/Basemap' ;
99import esriConfig from '@arcgis/core/config' ;
10+ import { watch } from '@arcgis/core/core/reactiveUtils.js' ;
1011import Point from '@arcgis/core/geometry/Point' ;
1112import BaseElevationLayer from '@arcgis/core/layers/BaseElevationLayer' ;
1213import ElevationLayer from '@arcgis/core/layers/ElevationLayer' ;
@@ -199,11 +200,14 @@ export class Map3dElement extends connect(store)(LitElement) {
199200 this . view = view ;
200201 this . createLighting ( ) ;
201202
202- view . watch ( 'popup.visible' , ( visible ) => {
203- if ( visible == false ) {
204- store . dispatch ( setCurrentLiveId ( undefined ) ) ;
205- }
206- } ) ;
203+ watch (
204+ ( ) => view . popup ?. visible ,
205+ ( visible ) => {
206+ if ( visible == false ) {
207+ store . dispatch ( setCurrentLiveId ( undefined ) ) ;
208+ }
209+ } ,
210+ ) ;
207211 if ( view . popup ) {
208212 view . popup . viewModel . includeDefaultActions = false ;
209213 }
@@ -244,7 +248,10 @@ export class Map3dElement extends connect(store)(LitElement) {
244248 this . center ( { ...location , alt : 0 } , zoom ) ;
245249 }
246250
247- view . watch ( 'center' , ( point : Point ) => this . handleLocation ( { lat : point . latitude ! , lon : point . longitude ! } ) ) ;
251+ watch (
252+ ( ) => view . center ,
253+ ( point : Point ) => this . handleLocation ( { lat : point . latitude ! , lon : point . longitude ! } ) ,
254+ ) ;
248255 } )
249256 . catch ( async ( e ) => {
250257 store . dispatch ( setApiLoading ( false ) ) ;
0 commit comments