Commit a5b9479 1 parent 06629e5 commit a5b9479 Copy full SHA for a5b9479
File tree 3 files changed +13
-14
lines changed
3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ export function behaviorHash(context) {
196
196
const selectIds = q . id . split ( ',' ) ;
197
197
if ( selectIds . length === 1 && selectIds [ 0 ] . startsWith ( 'note/' ) ) {
198
198
const noteId = selectIds [ 0 ] . split ( '/' ) [ 1 ] ;
199
- context . zoomToNote ( noteId , ! q . map ) ;
199
+ context . moveToNote ( noteId , ! q . map ) ;
200
200
} else {
201
201
context . zoomToEntities (
202
202
// convert ids to short form id: node/123 -> n123
Original file line number Diff line number Diff line change @@ -219,22 +219,21 @@ export function coreContext() {
219
219
} ) ;
220
220
} ;
221
221
222
- context . zoomToNote = ( noteId , zoomTo ) => {
222
+ context . moveToNote = ( noteId , moveTo ) => {
223
223
context . loadNote ( noteId , ( err , result ) => {
224
224
if ( err ) return ;
225
225
const entity = result . data . find ( e => e . id === noteId ) ;
226
- if ( entity ) {
227
- // zoom to, used note loc
228
- const note = services . osm . getNote ( noteId ) ;
229
- if ( zoomTo !== false ) {
230
- context . map ( ) . centerZoom ( note . loc , 15 ) ;
231
- }
232
- // open note layer
233
- const noteLayer = context . layers ( ) . layer ( 'notes' ) ;
234
- noteLayer . enabled ( true ) ;
235
- // select the note
236
- context . enter ( modeSelectNote ( context , noteId ) ) ;
226
+ if ( ! entity ) return ;
227
+ // zoom to, used note loc
228
+ const note = services . osm . getNote ( noteId ) ;
229
+ if ( moveTo !== false ) {
230
+ context . map ( ) . center ( note . loc ) ;
237
231
}
232
+ // open note layer
233
+ const noteLayer = context . layers ( ) . layer ( 'notes' ) ;
234
+ noteLayer . enabled ( true ) ;
235
+ // select the note
236
+ context . enter ( modeSelectNote ( context , noteId ) ) ;
238
237
} ) ;
239
238
} ;
240
239
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ export function uiFeatureList(context) {
383
383
const noteId = d . id . replace ( / \D / g, '' ) ;
384
384
385
385
// load note
386
- context . zoomToNote ( noteId ) ;
386
+ context . moveToNote ( noteId ) ;
387
387
} else {
388
388
// download, zoom to, and select the entity with the given ID
389
389
context . zoomToEntity ( d . id ) ;
You can’t perform that action at this time.
0 commit comments