mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
18 lines
423 B
JavaScript
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;
|
|
}
|