mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-30 23:47:59 +02:00
fix note not loading when both id and map hash parameters are set
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user