From cd1bf16dcd8063a240e4d6137fd4bfd3ef8f6006 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Fri, 6 Nov 2020 15:51:40 -0500 Subject: [PATCH] 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) --- modules/core/context.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/core/context.js b/modules/core/context.js index dd561073c..34efd365c 100644 --- a/modules/core/context.js +++ b/modules/core/context.js @@ -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;