fix note not loading when both id and map hash parameters are set

This commit is contained in:
Martin Raifer
2024-08-21 11:12:25 +02:00
parent c909ca76ca
commit 942f0a0648
2 changed files with 15 additions and 8 deletions
+6
View File
@@ -49,6 +49,12 @@ _Breaking developer changes, which may affect downstream projects or sites that
#### :hammer: Development
# 2.30.1
##### 2024-Aug-21
* Fix note not loading when iD is started with both an `id=note/123` and `map=…` hash parameter
# 2.30.0
##### 2024-Aug-21
+9 -8
View File
@@ -222,17 +222,18 @@ export function coreContext() {
context.zoomToNote = (noteId, zoomTo) => {
context.loadNote(noteId, (err, result) => {
if (err) return;
if (zoomTo === false) return;
const entity = result.data.find(e => e.id === noteId);
if (entity) {
// zoom to, used note loc
const note = services.osm.getNote(noteId);
// zoom to, used note loc
const note = services.osm.getNote(noteId);
if (zoomTo !== false) {
context.map().centerZoom(note.loc,15);
// open note layer
const noteLayer = context.layers().layer('notes');
noteLayer.enabled(true);
// select the note
context.enter(modeSelectNote(context, noteId));
}
// open note layer
const noteLayer = context.layers().layer('notes');
noteLayer.enabled(true);
// select the note
context.enter(modeSelectNote(context, noteId));
}
});
};