Open Cyrille37 opened 2 months ago
Hi @mcguffin
It would be nice to be able to call map.setView() in marker-geocode-result for customization.
map.setView()
marker-geocode-result
Perhaps reversing these two lines would be enough ?
// map-input.js // initGeocode() // this.geocoder this.el.dispatchEvent( new CustomEvent( 'osm-editor/marker-geocode-result', { detail: { model, geocode: e.geocode, previousGeocode } } ), { bubbles: true } ) this.map.setView( latlng, this.map.getZoom() ); // keep zoom, might be confusing else
My first thought was to use getBounds() if this.config.max_markers == 1 like :
this.config.max_markers == 1
if ( this.maxMarkers === 1 ) { this.map.setView( latlng, 17 ); } else { this.map.setView( latlng, this.map.getZoom() ); // keep zoom, might be confusing else } this.el.dispatchEvent( new CustomEvent( 'osm-editor/marker-geocode-result', { detail: { model, geocode: e.geocode, previousGeocode } } ), { bubbles: true } )
Thanks & cheers
Hi @mcguffin
It would be nice to be able to call
map.setView()
inmarker-geocode-result
for customization.Perhaps reversing these two lines would be enough ?
My first thought was to use getBounds() if
this.config.max_markers == 1
like :Thanks & cheers