From 6cab2c076cc29a157d5c794d732276cf96d861b5 Mon Sep 17 00:00:00 2001 From: Matthew Kalinin Date: Mon, 10 Jun 2024 16:50:03 +0300 Subject: [PATCH 1/2] Fixed adding extra child just detach --- src/controls/MMapGeolocationControl/index.ts | 2 ++ src/controls/MMapRotateControl/index.ts | 12 ++++++------ .../MMapRotateTiltControl/MMapRotateControl.ts | 5 ++--- .../MMapRotateTiltControl/MMapTiltControl.ts | 5 ++--- src/controls/MMapRotateTiltControl/index.ts | 4 +--- src/controls/MMapSearchControl/index.ts | 1 + src/controls/MMapTiltControl/index.ts | 3 --- src/controls/MMapZoomControl/index.ts | 1 + src/markers/MMapDefaultMarker/index.ts | 4 ++++ src/markers/MMapPopupMarker/index.ts | 4 ++++ 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/controls/MMapGeolocationControl/index.ts b/src/controls/MMapGeolocationControl/index.ts index 356bd5c..18bf74f 100644 --- a/src/controls/MMapGeolocationControl/index.ts +++ b/src/controls/MMapGeolocationControl/index.ts @@ -131,6 +131,8 @@ class MMapGeolocationControl extends mappable.MMapGroupEntity { static defaultProps = defaultProps; static [mappable.optionsKeyVuefy] = MMapRotateControlVuefyOptions; - private _control!: MMapControl; - private _rotateControl!: InternalRotateControl; + private _control: MMapControl; + private _rotateControl: InternalRotateControl; constructor(props: MMapRotateControlProps) { super(props); - } - - protected _onAttach(): void { this._control = new mappable.MMapControl({transparent: true}); this._rotateControl = new InternalRotateControl(this._props); @@ -64,12 +61,15 @@ export class InternalRotateControl extends mappable.MMapComplexEntity this._onMapUpdate(event.camera) }); this.addChild(this._listener); + } + protected _onAttach(): void { this._element = document.createElement('mappable'); this._element.textContent = 'N'; this._element.classList.add(ROTATE_CONTROL_CLASS); diff --git a/src/controls/MMapRotateTiltControl/MMapRotateControl.ts b/src/controls/MMapRotateTiltControl/MMapRotateControl.ts index 0c45166..4d2b3a6 100644 --- a/src/controls/MMapRotateTiltControl/MMapRotateControl.ts +++ b/src/controls/MMapRotateTiltControl/MMapRotateControl.ts @@ -22,14 +22,13 @@ export class MMapRotateControl extends mappable.MMapGroupEntity this._onMapUpdate(event.camera) }); this.addChild(this._listener); + } + protected _onAttach(): void { this._element = document.createElement('mappable'); this._element.classList.add(ROTATE_CONTROL_CLASS); diff --git a/src/controls/MMapRotateTiltControl/MMapTiltControl.ts b/src/controls/MMapRotateTiltControl/MMapTiltControl.ts index edd9e15..2f2f281 100644 --- a/src/controls/MMapRotateTiltControl/MMapTiltControl.ts +++ b/src/controls/MMapRotateTiltControl/MMapTiltControl.ts @@ -19,14 +19,13 @@ export class MMapTiltControl extends mappable.MMapComplexEntity this._onMapUpdate(event.camera) }); this.addChild(this._listener); + } + protected _onAttach(): void { this._element = document.createElement('mappable'); this._element.classList.add(TILT_CONTROL_CLASS); const {tilt, tiltRange} = this.root; diff --git a/src/controls/MMapRotateTiltControl/index.ts b/src/controls/MMapRotateTiltControl/index.ts index 7a3bbc1..4874fef 100644 --- a/src/controls/MMapRotateTiltControl/index.ts +++ b/src/controls/MMapRotateTiltControl/index.ts @@ -37,9 +37,6 @@ export class MMapRotateTiltControl extends mappable.MMapComplexEntity Date: Thu, 13 Jun 2024 15:32:26 +0300 Subject: [PATCH 2/2] fix issues --- src/controls/MMapZoomControl/index.ts | 1 - src/markers/MMapDefaultMarker/index.ts | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controls/MMapZoomControl/index.ts b/src/controls/MMapZoomControl/index.ts index 6d6e503..eef9bdf 100644 --- a/src/controls/MMapZoomControl/index.ts +++ b/src/controls/MMapZoomControl/index.ts @@ -192,7 +192,6 @@ class MMapZoomControl extends mappable.MMapComplexEntity