From 680eb7b121a17e9ec555c6de0479b6f16546e2d8 Mon Sep 17 00:00:00 2001 From: Matthew Kalinin Date: Fri, 31 May 2024 22:45:22 +0300 Subject: [PATCH] geolocation button --- .../MMapWaypointInput/index.ts | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/controls/MMapRouteControl/MMapWaypointInput/index.ts b/src/controls/MMapRouteControl/MMapWaypointInput/index.ts index 0a76705..b5b5d6f 100644 --- a/src/controls/MMapRouteControl/MMapWaypointInput/index.ts +++ b/src/controls/MMapRouteControl/MMapWaypointInput/index.ts @@ -47,12 +47,13 @@ export class MMapWaypointInput extends mappable.MMapComplexEntity { if (this._isHoverMode) { this._inputEl.focus(); + return; } if (event.relatedTarget !== this._suggestComponent.activeSuggest) { this.removeChild(this._suggestComponent); } + if (event.relatedTarget === this._locationButton) { + this._getGeolocation(); + return; + } this._indicator.innerHTML = ''; this._indicator.insertAdjacentHTML('afterbegin', emptyIndicatorSVG); }; @@ -206,6 +212,21 @@ export class MMapWaypointInput extends mappable.MMapComplexEntity