diff --git a/packages/core/src/providers/RemoteTileProvider/FixedLevelTileLoadDelegator.ts b/packages/core/src/providers/RemoteTileProvider/FixedLevelTileLoadDelegator.ts index 9e37bf7b6..b67e4d7d0 100644 --- a/packages/core/src/providers/RemoteTileProvider/FixedLevelTileLoadDelegator.ts +++ b/packages/core/src/providers/RemoteTileProvider/FixedLevelTileLoadDelegator.ts @@ -23,7 +23,6 @@ import {Tile} from '../../tile/Tile'; import TileProvider from '../TileProvider/TileProvider'; import {TileLoadDelegator} from './TileLoadDelegator'; import {tileUtils} from '@here/xyz-maps-core'; -import {add} from '@here/xyz-maps-common/src/Vec3'; let UNDEF; diff --git a/packages/display/src/Map.ts b/packages/display/src/Map.ts index 38cb8e227..3503bd5f2 100644 --- a/packages/display/src/Map.ts +++ b/packages/display/src/Map.ts @@ -25,7 +25,7 @@ import {Behavior, BehaviorOptions} from './behavior/Behavior'; import {EventDispatcher} from './event/Dispatcher'; import {Search} from './search/Search'; import {MapEvent} from './event/Event'; -import MVCRecognizer from './MVCRecognizer'; +import MapViewListener from './MapViewListener'; import UI from './ui/UI'; import {JSUtils, Listener} from '@here/xyz-maps-common'; import {ZoomAnimator} from './animation/ZoomAnimator'; @@ -130,7 +130,7 @@ export class Map { _s: number = 1; // current scale private _display: BasicDisplay; - private _mvcRecognizer: MVCRecognizer; + private _mvListener: MapViewListener; private _rz: number = 0; // rotation z in rad private _rx: number = 0; // rotation x in rad private _z: number; // zoom level @@ -265,7 +265,7 @@ export class Map { options['renderOptions'] || {} ); - tigerMap._mvcRecognizer = new MVCRecognizer(tigerMap, + tigerMap._mvListener = new MapViewListener(tigerMap, function triggerEventListeners(type, detail, sync) { listeners.trigger( type, @@ -388,7 +388,7 @@ export class Map { const centerGeo = this._c; const prevCenterGeo = this._pc; - this._mvcRecognizer.watch(true); + this._mvListener.watch(true); this._groundResolution = earthCircumference(centerGeo.latitude) / this._worldSizeFixed; @@ -1558,7 +1558,7 @@ export class Map { mapEl.parentNode.removeChild(mapEl); - this._mvcRecognizer.watch(false); + this._mvListener.watch(false); this._evDispatcher.destroy(); diff --git a/packages/display/src/MVCRecognizer.ts b/packages/display/src/MapViewListener.ts similarity index 99% rename from packages/display/src/MVCRecognizer.ts rename to packages/display/src/MapViewListener.ts index 40e6323de..e9e793dea 100644 --- a/packages/display/src/MVCRecognizer.ts +++ b/packages/display/src/MapViewListener.ts @@ -48,7 +48,7 @@ const createEvent = (eventName: string, map, layer): Event => { }; -class MVCRecognizer { +class MapViewListener { private readyTimer: number; private watchTimer: number = null; private viewport: GeoRect; @@ -199,4 +199,4 @@ class MVCRecognizer { }; } -export default MVCRecognizer; +export default MapViewListener; diff --git a/packages/editor/src/API/Editor.ts b/packages/editor/src/API/Editor.ts index f6b3858fa..6dd89f7f1 100644 --- a/packages/editor/src/API/Editor.ts +++ b/packages/editor/src/API/Editor.ts @@ -749,14 +749,13 @@ export default class Editor { const lid = getIdentifier(prov); if (prov.__type == 'FeatureProvider' && prov.editable && layerMap[lid]) { + delete layerMap[lid]; + layers.splice(layers.indexOf(layer), 1); + iEditor.listeners.trigger('_layerRemove', { layer: layer }); - delete layerMap[lid]; - - layers.splice(layers.indexOf(layer), 1); - toggleProviderHooks('remove', prov, iEditor); delete prov._e; diff --git a/packages/editor/src/DisplayListener.ts b/packages/editor/src/DisplayListener.ts index 09b1fa306..77deb0617 100644 --- a/packages/editor/src/DisplayListener.ts +++ b/packages/editor/src/DisplayListener.ts @@ -19,6 +19,7 @@ import {Set} from '@here/xyz-maps-common'; import InternalEditor from './IEditor'; +import ObserverHandler from './handlers/ObserverHandler'; export default class DisplayListener { // private layers = {}; @@ -27,7 +28,7 @@ export default class DisplayListener { private busy: Set = null; - private observers: any; + private observers: ObserverHandler; private iEdit; @@ -51,6 +52,10 @@ export default class DisplayListener { HERE_WIKI.listeners.add('_layerRemove', (ev) => { ev.detail.layer.removeEventListener('viewportReady', this.onStop); + this.busy?.delete(ev.detail.layer); + if (!this.busy?.size && !this.iEdit.layers.length) { + this.observers.change('ready', true); + } }); }