Selfies: Difference between revisions
From Treeverse
More actions
No edit summary |
No edit summary |
||
| Line 86: | Line 86: | ||
map.fitBounds(bounds); | map.fitBounds(bounds); | ||
// After fitting, | // After fitting, center map (middle of image) | ||
setTimeout(() => { | setTimeout(() => { | ||
try { | try { | ||
const z = map.getZoom(); | const z = map.getZoom(); | ||
map.setView([h/2, w], z, { animate:false }); | map.setView([h/2, w/2], z, { animate:false }); | ||
} catch(e) {} | } catch(e) {} | ||
}, 0); | }, 0); | ||