Files
iD/modules/actions/move_note.js
2018-07-21 21:44:07 -04:00

18 lines
423 B
JavaScript

import { geoVecInterp } from '../geo';
import { services } from '../services';
export function actionMoveNote(noteID, toLoc) {
var action = function(graph, t) {
if (t === null || !isFinite(t)) t = 1;
t = Math.min(Math.max(+t, 0), 1);
var note = services.osm.getNote(noteID);
note.move(geoVecInterp(note.loc, toLoc, t));
};
action.transitionable = true;
return action;
}