mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Download, select, and display the feature specified in the URL upon load even if the map parameter is zoomed out beyond the editable extent (close #8122)
This commit is contained in:
@@ -185,15 +185,17 @@ export function coreContext() {
|
||||
};
|
||||
|
||||
context.zoomToEntity = (entityID, zoomTo) => {
|
||||
if (zoomTo !== false) {
|
||||
context.loadEntity(entityID, (err, result) => {
|
||||
if (err) return;
|
||||
const entity = result.data.find(e => e.id === entityID);
|
||||
if (entity) {
|
||||
_map.zoomTo(entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// be sure to load the entity even if we're not going to zoom to it
|
||||
context.loadEntity(entityID, (err, result) => {
|
||||
if (err) return;
|
||||
if (zoomTo !== false) {
|
||||
const entity = result.data.find(e => e.id === entityID);
|
||||
if (entity) {
|
||||
_map.zoomTo(entity);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
_map.on('drawn.zoomToEntity', () => {
|
||||
if (!context.hasEntity(entityID)) return;
|
||||
|
||||
Reference in New Issue
Block a user