Skip to content

Commit 557ee59

Browse files
authored
Enable layers with embedded GeoJSON to use graduated, categorized, and canoncal symbology (#1020)
* Enable layers with embedded GeoJSON to use graduated, categorized, and canonical symbology * Remove unnecessary optional chaining operator
1 parent 31a0bb4 commit 557ee59

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

packages/base/src/dialogs/symbology/hooks/useGetProperties.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ async function getGeoJsonProperties({
2525
}): Promise<Record<string, Set<any>>> {
2626
const result: Record<string, Set<any>> = {};
2727

28-
const data = await loadFile({
29-
filepath: source.parameters?.path,
30-
type: 'GeoJSONSource',
31-
model,
32-
});
28+
const data = await (async () => {
29+
if (source.parameters.path) {
30+
return await loadFile({
31+
filepath: source.parameters.path,
32+
type: 'GeoJSONSource',
33+
model,
34+
});
35+
} else if (source.parameters.data) {
36+
return source.parameters.data;
37+
}
38+
})();
3339

3440
if (!data) {
3541
throw new Error('Failed to read GeoJSON data');

0 commit comments

Comments
 (0)