dist and time

finishing route
This commit is contained in:
muerwre 2018-08-24 12:36:36 +07:00
parent 102328a1b2
commit b8545105c8
15 changed files with 195 additions and 37 deletions

View file

@ -11,14 +11,19 @@ export class Editor {
mode,
setMode,
setRouterPoints,
setTotalDist,
}) {
this.map = new Map({ container });
const { lockMapClicks, routerMoveStart, map: { map } } = this;
const {
lockMapClicks, routerMoveStart, changeMode, pushPolyPoints, map: { map }
} = this;
this.poly = new Poly({ map, routerMoveStart, lockMapClicks });
this.poly = new Poly({ map, routerMoveStart, lockMapClicks, setTotalDist });
this.stickers = new Stickers({ map, lockMapClicks });
this.router = new Router({ map, lockMapClicks, setRouterPoints });
this.router = new Router({
map, lockMapClicks, setRouterPoints, changeMode, pushPolyPoints
});
this.shotter = new Shotter({ map });
this.setMode = setMode;
@ -98,6 +103,10 @@ export class Editor {
routerMoveStart = () => {
const { _latlngs } = this.poly.poly;
if (_latlngs) this.router.moveStart(_latlngs[_latlngs.length-1]);
if (_latlngs) this.router.moveStart(_latlngs[_latlngs.length - 1]);
};
pushPolyPoints = latlngs => {
this.poly.pushPoints(latlngs);
}
}