router now continues after confirmation

This commit is contained in:
muerwre 2018-08-24 15:04:49 +07:00
parent acc7cf6a22
commit fd01e69075
3 changed files with 16 additions and 14 deletions

View file

@ -38,22 +38,22 @@ export class EditorPanel extends React.PureComponent {
<span>РЕДАКТОР</span>
</button>
</div>
</div>
<div className="panel right">
<div className="control-dist">
{(totalDistance > 0)
?
<React.Fragment>
{totalDistance} км
<Icon icon="icon-cycle" size={32} />
{
(estimateTime > 0) && (estimateTime > 0) && <span>{toHours(estimateTime)}</span>
}
</React.Fragment>
<React.Fragment>
{totalDistance} км
<Icon icon="icon-cycle" size={32} />
{
(estimateTime > 0) && (estimateTime > 0) && <span>{toHours(estimateTime)}</span>
}
</React.Fragment>
: <div>Начните рисовать --&gt;</div>
}
</div>
</div>
<div className="panel right">
<div className="control-bar">
<button
className={classnames({ active: mode === MODES.ROUTER })}

View file

@ -124,9 +124,11 @@ export class Router {
const [route] = this.router._routes;
if (!route) return;
const { coordinates, summary: { totalDistance } } = route;
const { coordinates } = route;
this.pushPolyPoints(coordinates);
this.router.setWaypoints([]);
this.changeMode(MODES.POLY);
const waypoints = this.router.getWaypoints().filter(({ latLng }) => !!latLng);
this.router.setWaypoints(waypoints[waypoints.length-1]);
// this.changeMode(MODES.POLY);
};
}

View file

@ -11,7 +11,7 @@
padding: 0 10px;
display: flex;
align-items: center;
border-radius: 3px 0 0 3px;
border-radius: 0 3px 3px 0;
font-weight: 200;
color: #cccccc;
user-select: none;