Skip to content

Commit 569f534

Browse files
authored
fix issue where feature layer gets messed up when locator overlay layer is added (#2775)
* fix issue where feature layer gets messed up when locator overlay layer is added * rerun jobs
1 parent 5bcc94e commit 569f534

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/EnhancedMap/SourcedTileLayer/SourcedTileLayer.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ const SourcedTileLayerInternal = (props) => {
6060

6161
const normalizedLayer = normalizeLayer(props.source);
6262

63+
// Skip rendering if the tile URLhas unresolved template variables (e.g. {apikey})
64+
if (normalizedLayer.url) {
65+
const unresolvedVars = normalizedLayer.url.match(/\{(?!s|x|y|z|r\})[a-zA-Z_]+\}/g);
66+
if (unresolvedVars?.length > 0) {
67+
return null;
68+
}
69+
}
70+
6371
const handleTileError = () => {
6472
setLayerRenderFailed(true);
6573
};

0 commit comments

Comments
 (0)