From 5c4b6d4db6fabebf33450a0ae5273731efcefec7 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:04:36 -0700 Subject: [PATCH 01/12] Add ECMWF attribution --- src/components/MapboxMap/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/MapboxMap/index.tsx b/src/components/MapboxMap/index.tsx index bb6e857..6e9c066 100644 --- a/src/components/MapboxMap/index.tsx +++ b/src/components/MapboxMap/index.tsx @@ -101,6 +101,9 @@ const MapboxMap = ({ transformRequest, accessToken: token, }); + newMap.addControl(new mapboxgl.AttributionControl({ + customAttribution: 'Based on data and products of the European Center for Medium-Range Weather Forecasts (ECMWF)' + }), 'bottom-left'); newMap.on("load", () => { setMap(newMap); }); From 59189779c726a79b0ced79981804902068cf2fe6 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:04:43 -0700 Subject: [PATCH 02/12] 2.1.1-rc.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b56a1a1..f76dbbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.0", + "version": "2.1.1-rc.0", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts", From 7cffc03351408262db3e4832dd9943fbd3e4d260 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:08:15 -0700 Subject: [PATCH 03/12] Fix package.json I guess --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f76dbbf..5edeedb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "author": "Wayfinder Engineering ", "license": "MIT", "private": false, - "repository": "https://github.com/wavespotter/mapbox-context", + "repository": { + "type": "git", + "url": "git+https://github.com/wavespotter/mapbox-context.git" + }, "homepage": "https://github.com/wavespotter/mapbox-context", "files": [ "package.json", From 6b8d33cecfb27c7bb11c13dac7ebd2eea82e3dd8 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:21:11 -0700 Subject: [PATCH 04/12] Shorten the text --- src/components/MapboxMap/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MapboxMap/index.tsx b/src/components/MapboxMap/index.tsx index 6e9c066..b526d27 100644 --- a/src/components/MapboxMap/index.tsx +++ b/src/components/MapboxMap/index.tsx @@ -102,8 +102,8 @@ const MapboxMap = ({ accessToken: token, }); newMap.addControl(new mapboxgl.AttributionControl({ - customAttribution: 'Based on data and products of the European Center for Medium-Range Weather Forecasts (ECMWF)' - }), 'bottom-left'); + customAttribution: 'European Center for Medium-Range Weather Forecasts' + })); newMap.on("load", () => { setMap(newMap); }); From 8e46b4c5878380e53961e176d9b9b532f612b0a2 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:21:52 -0700 Subject: [PATCH 05/12] 2.1.1-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5edeedb..f0b6ede 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.1-rc.0", + "version": "2.1.1-rc.1", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts", From e364078bb332ab8c4c05c994ec612c6121bcfead Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:49:13 -0700 Subject: [PATCH 06/12] Center and shorten attribution --- src/components/MapboxMap/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MapboxMap/index.tsx b/src/components/MapboxMap/index.tsx index b526d27..dd6b3a0 100644 --- a/src/components/MapboxMap/index.tsx +++ b/src/components/MapboxMap/index.tsx @@ -102,8 +102,8 @@ const MapboxMap = ({ accessToken: token, }); newMap.addControl(new mapboxgl.AttributionControl({ - customAttribution: 'European Center for Medium-Range Weather Forecasts' - })); + customAttribution: 'ECMWF' + }), "bottom"); newMap.on("load", () => { setMap(newMap); }); From fadab69b6b34104662cd46ee3fd248c3c628b108 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 15:53:50 -0700 Subject: [PATCH 07/12] 2.1.1-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0b6ede..2b98564 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.1-rc.1", + "version": "2.1.1-rc.2", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts", From 269f6118da9e08e8c46d0879d1dcff9c26aa1698 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 16:05:52 -0700 Subject: [PATCH 08/12] Try bottom left again --- src/components/MapboxMap/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MapboxMap/index.tsx b/src/components/MapboxMap/index.tsx index dd6b3a0..20954e6 100644 --- a/src/components/MapboxMap/index.tsx +++ b/src/components/MapboxMap/index.tsx @@ -103,7 +103,7 @@ const MapboxMap = ({ }); newMap.addControl(new mapboxgl.AttributionControl({ customAttribution: 'ECMWF' - }), "bottom"); + }), "bottom-left"); newMap.on("load", () => { setMap(newMap); }); From e8f1680b6a0f10e2d83ed753ca09e29113d35407 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Tue, 17 Mar 2026 16:06:07 -0700 Subject: [PATCH 09/12] 2.1.1-rc.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b98564..3c4e1de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.1-rc.2", + "version": "2.1.1-rc.3", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts", From ebc72a6e00a84fb72074ba69fbf3c01743e8ab5d Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Thu, 19 Mar 2026 13:29:51 -0700 Subject: [PATCH 10/12] Add some CSS to stack Mapbox logo and attribution --- package.json | 1 + src/components/MapboxMap/index.tsx | 5 ++--- src/components/MapboxMap/map.css | 4 ++++ vite.config.js | 2 ++ yarn.lock | 10 +++++----- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 src/components/MapboxMap/map.css diff --git a/package.json b/package.json index 3c4e1de..dbce582 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "typescript": "^5.9.2", "typescript-eslint": "^8.41.0", "vite": "^7.1.2", + "vite-plugin-css-injected-by-js": "^4.0.1", "vite-plugin-dts": "^4.5.4", "vitest": "^3.2.4" }, diff --git a/src/components/MapboxMap/index.tsx b/src/components/MapboxMap/index.tsx index 20954e6..761bb28 100644 --- a/src/components/MapboxMap/index.tsx +++ b/src/components/MapboxMap/index.tsx @@ -1,3 +1,4 @@ +import "./map.css"; import mapboxgl, { LngLatBoundsLike, LngLatLike, @@ -101,9 +102,7 @@ const MapboxMap = ({ transformRequest, accessToken: token, }); - newMap.addControl(new mapboxgl.AttributionControl({ - customAttribution: 'ECMWF' - }), "bottom-left"); + newMap.addControl(new mapboxgl.AttributionControl(), "bottom-left"); newMap.on("load", () => { setMap(newMap); }); diff --git a/src/components/MapboxMap/map.css b/src/components/MapboxMap/map.css new file mode 100644 index 0000000..bf789d0 --- /dev/null +++ b/src/components/MapboxMap/map.css @@ -0,0 +1,4 @@ +.mapboxgl-ctrl-bottom-left { + display: flex; + flex-direction: column-reverse; +} \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 2689e98..f2f484b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,10 +3,12 @@ import { dirname } from "node:path"; import { fileURLToPath, URL } from "node:url"; import { extname, relative, resolve } from "path"; import { defineConfig } from "vite"; +import cssInjectedByJs from "vite-plugin-css-injected-by-js"; import dts from "vite-plugin-dts"; export default defineConfig({ plugins: [ + cssInjectedByJs(), dts({ exclude: ["**/*.stories.tsx", "**/storybook-helpers/*"], }), diff --git a/yarn.lock b/yarn.lock index 7b5b3d6..c02951a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4010,11 +4010,6 @@ node-releases@^2.0.19: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - open@^8.0.4: version "8.4.2" resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" @@ -4871,6 +4866,11 @@ vite-node@3.2.4: pathe "^2.0.3" vite "^5.0.0 || ^6.0.0 || ^7.0.0-0" +vite-plugin-css-injected-by-js@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-4.0.1.tgz#ed69dd8f04800f9e3c7a17c3a2e3819eede6092e" + integrity sha512-WfyRojojQyAO/KzWf+efcXpTPv6zJPXaRmr9EYq5a4v5I3PWCR7kR01hiri2lW6+rHm3a57kpwsf+iahIJi1Qw== + vite-plugin-dts@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/vite-plugin-dts/-/vite-plugin-dts-4.5.4.tgz#51b60aaaa760d9cf5c2bb3676c69d81910d6b08c" From 159aeadfd4494803ccb3f417f0aac8f70c04c049 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Thu, 19 Mar 2026 13:29:57 -0700 Subject: [PATCH 11/12] 2.1.1-rc.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbce582..2f52f29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.1-rc.3", + "version": "2.1.1-rc.4", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts", From 0bc4b60fd1045640058e4a7777225297234d8c3e Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Thu, 19 Mar 2026 13:41:22 -0700 Subject: [PATCH 12/12] 2.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f52f29..2a5bdfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sofarocean/mapbox-context", - "version": "2.1.1-rc.4", + "version": "2.2.0", "description": "A React wrapper for Mapbox GL JS built for the era of React Context and Hooks", "main": "dist/index.js", "types": "dist/index.d.ts",