diff --git a/example/README.md b/example/README.md index 21a30f2..6247b49 100644 --- a/example/README.md +++ b/example/README.md @@ -129,5 +129,7 @@ including double-clicking to delete a point and a steering wheel with two button ([source code](https://github.com/mappable-world/mappable-default-ui-theme/tree/main/example/popups-on-map)) - [Adding a search control to the map](./search-control/vanilla/index.html) ([source code](https://github.com/mappable-world/mappable-default-ui-theme/tree/main/example/search-control)) +- [Adding a route control to the map](./route-control/vanilla/index.html) + ([source code](https://github.com/mappable-world/mappable-default-ui-theme/tree/main/example/route-control)) - [Adding a default ruler to the map](./default-ruler/vanilla/index.html) ([source code](https://github.com/mappable-world/mappable-default-ui-theme/tree/main/example/default-ruler)) diff --git a/src/markers/MMapDefaultMarker/index.ts b/src/markers/MMapDefaultMarker/index.ts index fb24fec..466f5c5 100644 --- a/src/markers/MMapDefaultMarker/index.ts +++ b/src/markers/MMapDefaultMarker/index.ts @@ -139,7 +139,8 @@ export class MMapDefaultMarker extends mappable.MMapComplexEntity { - if (!this._popup) { - return; + if (this._popup) { + this._popup.update({show: this._popup.isOpen}); } - this._popup.update({show: !this._popup.isOpen}); this._props.onClick?.(...args); }; + private _onMarkerDragMove: MMapDefaultMarkerProps['onDragMove'] = (coordinates) => { + if (this._popup) { + this._popup.update({coordinates}); + } + this._props.onDragMove?.(coordinates); + }; + private _updateTheme() { const themeCtx = this._consumeContext(mappable.ThemeContext); const theme = themeCtx.theme;