Skip to content

Commit

Permalink
Merge pull request #9 from hkfb/annotation
Browse files Browse the repository at this point in the history
test: Annotations story
  • Loading branch information
hkfb authored Feb 22, 2024
2 parents 3bde432 + 49f8955 commit e84c760
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions src/components/gpx-map.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import * as React from "react";
import { GpxMap } from "./gpx-map";
import type { Meta, StoryObj } from "@storybook/react";
import { GpxMap, DEFAULT_GPX_FILE } from "./gpx-map";
import { TripGpxLayer } from "../layers/trip-gpx-layer";

export default {
const meta: Meta<typeof GpxMap> = {
title: "GPX Map",
tags: ["autodocs"],
component: GpxMap,
};

export function GpxMapDefault() {
return <GpxMap />;
}
export default meta;

export function GpxMapJotunheimenRundt() {
const initialViewState = {
longitude: 8.3,
latitude: 61.4,
zoom: 8,
};
type Story = StoryObj<typeof GpxMap>;

const gpxUrl = "Jotunheimen_rundt.gpx";
return <GpxMap gpx={gpxUrl} initialViewState={initialViewState} />;
}
export const Default: Story = {};

export const JotunheimenRundt: Story = {
args: {
initialViewState: {
longitude: 8.3,
latitude: 61.4,
zoom: 8,
},

gpx: "Jotunheimen_rundt.gpx",
},
};

export function GpxMapText() {
return (
Expand All @@ -27,3 +34,11 @@ export function GpxMapText() {
</GpxMap>
);
}

export const AnnotationLayer: Story = {
args: {
annotationLayers: [
new TripGpxLayer({ id: "trip", data: DEFAULT_GPX_FILE }),
],
},
};

0 comments on commit e84c760

Please sign in to comment.