Skip to content

Commit

Permalink
Migrate to mapbox #997 - Fix weird touch issue after editing is compl…
Browse files Browse the repository at this point in the history
…eted.
  • Loading branch information
HarelM committed Apr 22, 2019
1 parent 5e12016 commit 89bb21c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class RouteEditRouteInteraction {

public setActive(active: boolean, map: Map) {
this.map = map;
// HM TODO: touchmove?
// HM TODO: touchmove? remove console.log
if (active) {
map.on("mousedown", this.handleDown);
// map.on("touchstart", this.handleDown);
Expand All @@ -94,6 +94,7 @@ export class RouteEditRouteInteraction {
map.off("mousedown", this.handleDown);
// map.off("touchstart", this.handleDown);
map.off("mousemove", this.handleMove);
map.off("drag", this.handleMove);
map.off("mouseup", this.handleUp);
// map.off("touchend", this.handleUp);
}
Expand Down Expand Up @@ -208,6 +209,8 @@ export class RouteEditRouteInteraction {

private handleUp = (event: MapMouseEvent) => {
console.log("up");
this.map.on("mousemove", this.handleMove);
this.map.off("drag", this.handleMove);
let isDragging = this.state === "dragging";
this.state = "none";
let updating = this.selectedRoutePoint != null || this.selectedRouteSegments.length !== 0;
Expand Down

0 comments on commit 89bb21c

Please sign in to comment.