From f74d21557ca7081413841d00ddcb372603f2dbde Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 24 Jul 2018 19:34:01 -0400 Subject: [PATCH] Force redraws after moving a note or cancelling a note similar to 95ea0dbbc, there is no history change event to force a redraw --- modules/modes/drag_note.js | 3 +++ modules/renderer/map.js | 3 +-- modules/ui/note_editor.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/modes/drag_note.js b/modules/modes/drag_note.js index b686e8be2..7b1ca0106 100644 --- a/modules/modes/drag_note.js +++ b/modules/modes/drag_note.js @@ -86,6 +86,9 @@ export function modeDragNote(context) { function end(note) { + // force a reraw (there is no history change that would otherwise do this) + context.pan([0,0]); + context .selectedNoteID(note.id) .enter(modeSelectNote(context, note.id)); diff --git a/modules/renderer/map.js b/modules/renderer/map.js index e19b1d2dd..727ae3323 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -480,8 +480,7 @@ export function rendererMap(context) { .call(drawLayers); // OSM - // NOTE: when `map.notesEditable()` is removed, `redraw()` keep being called on timer - if (map.editable() || map.notesEditable()) { + if (map.editable()) { context.loadTiles(projection); drawVector(difference, extent); } else { diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 235938511..a6fd9c573 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -330,6 +330,7 @@ export function uiNoteEditor(context) { osm.removeNote(d); } context.enter(modeBrowse(context)); + dispatch.call('change'); }); buttonSection.select('.save-button') // select and propagate data