From 606f79d4833cb95f027de4f10823dfb681f5f451 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 15 May 2023 15:17:00 +0100 Subject: [PATCH 1/2] Remove max-width for tooltips The Maplibre docs say that `options.maxWidth` is "A string that sets the CSS property of the popup's maximum width, eg '300px' . To ensure the popup resizes to fit its content, set this property to 'none'" https://maplibre.org/maplibre-gl-js-docs/api/markers/#popup --- app/src/MaplibreMap.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/MaplibreMap.tsx b/app/src/MaplibreMap.tsx index 33eda26..32f3018 100644 --- a/app/src/MaplibreMap.tsx +++ b/app/src/MaplibreMap.tsx @@ -381,6 +381,7 @@ function MaplibreMap(props: { file: PMTiles }) { const popup = new maplibregl.Popup({ closeButton: false, closeOnClick: false, + maxWidth: 'none', }); mapRef.current = map; From b1a4ecbc7d6e8e66e049a9e17ef9350856e72846 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 15 May 2023 17:07:14 +0100 Subject: [PATCH 2/2] change single to double quotes --- app/src/MaplibreMap.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/MaplibreMap.tsx b/app/src/MaplibreMap.tsx index 32f3018..6e81d7d 100644 --- a/app/src/MaplibreMap.tsx +++ b/app/src/MaplibreMap.tsx @@ -381,7 +381,7 @@ function MaplibreMap(props: { file: PMTiles }) { const popup = new maplibregl.Popup({ closeButton: false, closeOnClick: false, - maxWidth: 'none', + maxWidth: "none", }); mapRef.current = map;