Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Update map tile server settings with suggested copy from DOC-301 (#81835)

applebybfe0b19738a8
diff --git a/docs/configuring-metabase/custom-maps.md b/docs/configuring-metabase/custom-maps.md
index 7d685f37891..009089b88e0 100644
--- a/docs/configuring-metabase/custom-maps.md
+++ b/docs/configuring-metabase/custom-maps.md
@@ -27,7 +27,7 @@ The map tile server sets the background imagery for pin and grid maps. It's not
To change the map tile server:
1. Go to **Admin > Settings > Maps**.
-2. Under **Map tile server URL**, enter the URL template for your tile server.
+2. Under **Map tile server public URL**, enter the URL template for your tile server.
### Use a raster tile URL template
diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx
index 7e92cd304df..4b2aff88e22 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx
@@ -1,26 +1,34 @@
-import { t } from "ttag";
+import { jt, t } from "ttag";
import {
SettingsPageWrapper,
SettingsSection,
} from "metabase/admin/components/SettingsSection";
+import { ExternalLink } from "metabase/common/components/ExternalLink";
+import { useDocsUrl } from "metabase/common/hooks";
import { AdminSettingInput } from "../widgets/AdminSettingInput";
import { CustomGeoJSONWidget } from "../widgets/CustomGeoJSONWidget";
export function MapsSettingsPage() {
+ const { url: tileServerDocsUrl } = useDocsUrl(
+ "configuring-metabase/custom-maps",
+ { anchor: "map-tile-server" },
+ );
+
return (
<SettingsPageWrapper title={t`Maps`}>
<SettingsSection>
<AdminSettingInput
name="map-tile-server-url"
- title={t`Map tile server URL`}
+ title={t`Map tile server public URL`}
description={
<>
- <div>
- {t`URL of the map tile server to use for rendering maps. If you're using a custom map tile server, you can set it here.`}
- </div>
- <div>{t`Metabase uses OpenStreetMaps by default.`}</div>
+ {jt`Public URL of the tile server to use when rendering maps. Defaults to OpenStreetMaps, but you can set a custom URL. This URL is visible to clients, so do not include private keys. ${(
+ <ExternalLink key="tile-server-docs" href={tileServerDocsUrl}>
+ {t`Learn more`}
+ </ExternalLink>
+ )}`}
</>
}
inputType="text"
diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.unit.spec.tsx
index 3636c61b74b..396f08f351b 100644
--- a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.unit.spec.tsx
+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.unit.spec.tsx
@@ -87,7 +87,7 @@ const setup = async () => {
describe("MapsSettingsPage", () => {
it("should render the PublicSharingSettingsPage with public sharing disabled", async () => {
await setup();
- ["Map tile server URL", "Custom maps"].forEach((text) => {
+ ["Map tile server public URL", "Custom maps"].forEach((text) => {
expect(screen.getByText(text)).toBeInTheDocument();
});
expect(screen.getByDisplayValue("https://tiles.com")).toBeInTheDocument();
diff --git a/frontend/src/metabase/admin/settings/tests/setup.tsx b/frontend/src/metabase/admin/settings/tests/setup.tsx
index 12c85c844ea..cc43ff3c682 100644
--- a/frontend/src/metabase/admin/settings/tests/setup.tsx
+++ b/frontend/src/metabase/admin/settings/tests/setup.tsx
@@ -60,7 +60,7 @@ export const ossRoutes: RouteMap = {
path: "/authentication/api-keys",
testPattern: /Create API keys to let users authenticate/i,
},
- maps: { path: "/maps", testPattern: /Map tile server URL/i },
+ maps: { path: "/maps", testPattern: /Map tile server public URL/i },
localization: { path: "/localization", testPattern: /Instance language/i },
uploads: {
path: "/uploads",
diff --git a/src/metabase/tiles/settings.clj b/src/metabase/tiles/settings.clj
index e6d44d56ac9..b8339cb5671 100644
--- a/src/metabase/tiles/settings.clj
+++ b/src/metabase/tiles/settings.clj
@@ -73,7 +73,9 @@
(catch Throwable _ false)))))
(defsetting map-tile-server-url
- (i18n/deferred-tru "The map tile server URL template used in map visualizations, for example from OpenStreetMaps or MapBox.")
+ (i18n/deferred-tru
+ (str "The map tile server URL template used in map visualizations, for example from OpenStreetMaps or MapBox. "
+ "This URL is visible to clients, so do not include private keys."))
:encryption :when-encryption-key-set
:default "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
:visibility :public