mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
router now properly handles poly changes
This commit is contained in:
parent
e477f50283
commit
245b559e2d
3 changed files with 40 additions and 4 deletions
|
@ -12,9 +12,9 @@ export class Editor {
|
|||
}) {
|
||||
this.map = new Map({ container });
|
||||
|
||||
const { lockMapClicks, map: { map } } = this;
|
||||
const { lockMapClicks, routerMoveStart, map: { map } } = this;
|
||||
|
||||
this.poly = new Poly({ map: this.map.map });
|
||||
this.poly = new Poly({ map, routerMoveStart });
|
||||
this.stickers = new Stickers({ map, lockMapClicks });
|
||||
this.router = new Router({ map, lockMapClicks });
|
||||
|
||||
|
@ -88,4 +88,10 @@ export class Editor {
|
|||
|
||||
this.router.startFrom(latlngs.pop());
|
||||
};
|
||||
|
||||
routerMoveStart = () => {
|
||||
const { _latlngs } = this.poly.poly;
|
||||
|
||||
if (_latlngs) this.router.moveStart(_latlngs[_latlngs.length-1]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue