From 33ed0f0ec81375825550872c18538d38a3b30be7 Mon Sep 17 00:00:00 2001 From: yuiseki Date: Sat, 29 Jun 2024 15:29:18 +0900 Subject: [PATCH] feat: Add mapStyleOptions for different map styles --- src/components/Combined/OpenCellId/index.stories.ts | 11 ++--------- src/components/mapStyleOptions.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 src/components/mapStyleOptions.ts diff --git a/src/components/Combined/OpenCellId/index.stories.ts b/src/components/Combined/OpenCellId/index.stories.ts index 5eaf794..17846be 100644 --- a/src/components/Combined/OpenCellId/index.stories.ts +++ b/src/components/Combined/OpenCellId/index.stories.ts @@ -1,19 +1,12 @@ import { Meta, StoryObj } from "@storybook/react"; import { OpenCellIdWithStyle } from "."; +import { mapStyleOptions } from "../../mapStyleOptions"; const meta = { component: OpenCellIdWithStyle, argTypes: { mapStyle: { - options: [ - "stylejson/tile.openstreetmap.jp/fiord-color-gl-style/style.json", - "stylejson/tile.openstreetmap.fr/hot/style.json", - "stylejson/tile.openstreetmap.org/style.json", - "https://tile.openstreetmap.jp/styles/osm-bright/style.json", - "stylejson/geoservices.un.org/clearmap/style.json", - "stylejson/server.arcgisonline.com/world_imagery/style.json", - "stylejson/cyberjapandata.gsi.go.jp/xyz/seamlessphoto/style.json", - ], + options: mapStyleOptions, control: { type: "select" }, }, }, diff --git a/src/components/mapStyleOptions.ts b/src/components/mapStyleOptions.ts new file mode 100644 index 0000000..05e5463 --- /dev/null +++ b/src/components/mapStyleOptions.ts @@ -0,0 +1,9 @@ +export const mapStyleOptions = [ + "stylejson/tile.openstreetmap.jp/fiord-color-gl-style/style.json", + "stylejson/tile.openstreetmap.fr/hot/style.json", + "stylejson/tile.openstreetmap.org/style.json", + "https://tile.openstreetmap.jp/styles/osm-bright/style.json", + "stylejson/geoservices.un.org/clearmap/style.json", + "stylejson/server.arcgisonline.com/world_imagery/style.json", + "stylejson/cyberjapandata.gsi.go.jp/xyz/seamlessphoto/style.json", +];