Skip to content

Commit

Permalink
ui-warpedmap: fix path when loading data in stories
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Aug 2, 2024
1 parent 362d054 commit 3c4ac15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui-warped-map/src/stories/Algorithms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const AlgorithmsShowcase: FC<{ path: Feature<LineString>; warpingOptions: Warpin
const Algorithms: FC<{ path: string } & WarpingOptions> = (props) => {
const { path: pathName, ...warpingOptions } = props;
const pathState = useAsyncMemo(
() => fetch(`/${pathName}.json`).then((res) => res.json() as Promise<Feature<LineString>>),
() => fetch(`./${pathName}.json`).then((res) => res.json() as Promise<Feature<LineString>>),
[pathName]
);
const path = pathState.type === 'ready' ? pathState.data : null;
Expand Down
2 changes: 1 addition & 1 deletion ui-warped-map/src/stories/SampleMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const PATH_LAYER: Omit<LineLayer, 'source-layer'> = {

const SampleMap: FC<{ path: string }> = ({ path: pathName }) => {
const pathState = useAsyncMemo(
() => fetch(`/${pathName}.json`).then((res) => res.json() as Promise<Feature<LineString>>),
() => fetch(`./${pathName}.json`).then((res) => res.json() as Promise<Feature<LineString>>),
[pathName]
);
const path = pathState.type === 'ready' ? pathState.data : null;
Expand Down

0 comments on commit 3c4ac15

Please sign in to comment.