@@ -15,6 +15,7 @@ import { isColourValid } from '../osm/tags';
1515import { services } from '../services' ;
1616import { svgIcon } from '../svg/icon' ;
1717import { uiCmd } from './cmd' ;
18+ import { modeSelectNote } from '../modes' ;
1819
1920import {
2021 utilDisplayName ,
@@ -232,6 +233,12 @@ export function uiFeatureList(context) {
232233 type : t ( 'inspector.relation' ) ,
233234 name : q
234235 } ) ;
236+ result . push ( {
237+ id : 'note' + q ,
238+ geometry : 'note' ,
239+ type : t ( 'note.note' ) ,
240+ name : q
241+ } ) ;
235242 }
236243
237244 return result ;
@@ -353,6 +360,26 @@ export function uiFeatureList(context) {
353360 context . enter ( modeSelect ( context , [ d . entity . id ] ) ) ;
354361 context . map ( ) . zoomToEase ( d . entity ) ;
355362
363+ } else if ( d . geometry === 'note' ) {
364+ // note
365+ // get number part 'note12345'
366+ const noteId = d . id . replace ( / \D / g, '' ) ;
367+
368+ // load note
369+ context . loadNote ( noteId , ( err , result ) => {
370+ if ( err ) return ;
371+ const entity = result . data . find ( e => e . id === noteId ) ;
372+ if ( entity ) {
373+ // zoom to, used note loc
374+ const note = services . osm . getNote ( noteId ) ;
375+ context . map ( ) . centerZoom ( note . loc , 15 ) ;
376+ // open note layer
377+ const noteLayer = context . layers ( ) . layer ( 'notes' ) ;
378+ noteLayer . enabled ( true ) ;
379+ // select the note
380+ context . enter ( modeSelectNote ( context , noteId ) ) ;
381+ }
382+ } ) ;
356383 } else {
357384 // download, zoom to, and select the entity with the given ID
358385 context . zoomToEntity ( d . id ) ;
0 commit comments