Skip to content

Commit 4c9732b

Browse files
committed
Name the selection what it is
1 parent e3dedc6 commit 4c9732b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/layers/fameNatureAreas.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ async function readCapabilities(host: string): Promise<WmtsCapabilitiesJson> {
187187
* is what catches it: expect a failed tile and a console error rather than a clean stack.
188188
*/
189189
export function natureAreaViewParams(dataset: string, areas?: () => string[]): string {
190-
const wanted = areas?.() ?? [];
191-
if (wanted.length > 1) {
192-
throw new Error(`FAME draws one nature area at a time, not ${wanted.length}`);
190+
const selected = areas?.() ?? [];
191+
if (selected.length > 1) {
192+
throw new Error(`FAME draws one nature area at a time, not ${selected.length}`);
193193
}
194194

195-
const [only] = wanted;
196-
return encodeURIComponent(`dataset:${dataset}${only ? `;natura2000AreaCode:${only}` : ""}`);
195+
const [areaCode] = selected;
196+
return encodeURIComponent(`dataset:${dataset}${areaCode ? `;natura2000AreaCode:${areaCode}` : ""}`);
197197
}
198198

199199
function matrixSetFor(capabilities: WmtsCapabilitiesJson, epsgCode: string): Record<string, unknown> {

0 commit comments

Comments
 (0)