Skip to content

Commit

Permalink
Add un clear map dark style
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseki committed Aug 11, 2024
1 parent 2d78347 commit 40d8b42
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
21 changes: 21 additions & 0 deletions public/stylejson/geoservices.un.org/clearmap_dark/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": 8,
"sources": {
"un_clearmap": {
"type": "raster",
"tiles": [
"https://geoservices.un.org/arcgis/rest/services/ClearMap_WebDark/MapServer/tile/{z}/{y}/{x}"
],
"attribution": "<a href=\"https://www.un.org/geospatial/\">UN Geospatial</a>"
}
},
"layers": [
{
"id": "un_clearmap_dark",
"source": "un_clearmap_dark",
"type": "raster",
"maxzoom": 6,
"minzoom": 0
}
]
}
14 changes: 14 additions & 0 deletions src/components/Maps/UNClearMapDarkRaster/index.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Meta, StoryObj } from "@storybook/react";
import { UNClearMapDarkRaster as MapComponent } from ".";

const meta: Meta<typeof MapComponent> = {
component: MapComponent,
parameters: {
layout: 'fullscreen',
},
} satisfies Meta<typeof MapComponent>;

export default meta;
type Story = StoryObj<typeof MapComponent>;

export const Preview: Story = {};
19 changes: 19 additions & 0 deletions src/components/Maps/UNClearMapDarkRaster/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Map } from "react-map-gl/maplibre";
import "maplibre-gl/dist/maplibre-gl.css";

export const UNClearMapDarkRaster = () => {
return (
<Map
initialViewState={{
longitude: 0,
latitude: 0,
zoom: 4,
}}
dragPan={true}
scrollZoom={true}
hash={false}
style={{ width: "100%", height: "100%" }}
mapStyle="stylejson/geoservices.un.org/clearmap_dark/style.json"
/>
);
};

0 comments on commit 40d8b42

Please sign in to comment.