diff --git a/CHANGELOG.md b/CHANGELOG.md index e3199d7c..b86d60f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - The `maputnik` desktop binary now opens the default browser automatically on startup (opt out with `--no-browser`) - Keyboard shortcuts now keep working while the map has focus, instead of going dead until the map is blurred - The map no longer stays blank on load until it is moved, when the style loads before the map is ready +- The debug modal now shows the MapLibre options for any renderer other than OpenLayers (e.g. `mbgljs`) - _...Add new stuff here..._ ## 3.1.0 diff --git a/e2e/fixtures/example-style-with-mbgljs-renderer.json b/e2e/fixtures/example-style-with-mbgljs-renderer.json new file mode 100644 index 00000000..79b997ad --- /dev/null +++ b/e2e/fixtures/example-style-with-mbgljs-renderer.json @@ -0,0 +1,10 @@ +{ + "id": "test-style", + "version": 8, + "name": "Test Style", + "metadata": { + "maputnik:renderer": "mbgljs" + }, + "sources": {}, + "layers": [] +} diff --git a/e2e/maputnik-driver.ts b/e2e/maputnik-driver.ts index cfced9e5..cd0f2d7c 100644 --- a/e2e/maputnik-driver.ts +++ b/e2e/maputnik-driver.ts @@ -41,6 +41,7 @@ export class MaputnikDriver { "example-style-with-zoom-5-and-center-50-50.json", "access-token-style.json", "grouped-layers-style.json", + "example-style-with-mbgljs-renderer.json", ]; for (const fixture of styleFixtures) { await this.helper.given.interceptAndMockResponse({ @@ -93,6 +94,7 @@ export class MaputnikDriver { | "zoom_7_center_0_51" | "access_tokens" | "grouped_layers" + | "mbgljs_renderer" | "", zoom?: number ) => { @@ -106,6 +108,7 @@ export class MaputnikDriver { zoom_7_center_0_51: "example-style-with-zoom-7-and-center-0-51.json", access_tokens: "access-token-style.json", grouped_layers: "grouped-layers-style.json", + mbgljs_renderer: "example-style-with-mbgljs-renderer.json", }; const url = new URL(baseUrl); diff --git a/e2e/modals.spec.ts b/e2e/modals.spec.ts index 9d4bf88d..a3b3c6d5 100644 --- a/e2e/modals.spec.ts +++ b/e2e/modals.spec.ts @@ -88,6 +88,14 @@ describe("modals", () => { }); }); + describe("debug with a renderer other than mlgljs or ol", () => { + test("shows the map options", async () => { + await when.setStyle("mbgljs_renderer"); + await when.typeKeys("!"); + await then(get.elementByTestId("modal:debug.max-zoom")).shouldBeVisible(); + }); + }); + describe("export", () => { beforeEach(async () => { await when.click("nav:export"); diff --git a/src/components/modals/ModalDebug.tsx b/src/components/modals/ModalDebug.tsx index c3ec2390..086bf4f9 100644 --- a/src/components/modals/ModalDebug.tsx +++ b/src/components/modals/ModalDebug.tsx @@ -50,7 +50,7 @@ class ModalDebugInternal extends React.Component { >

{t("Options")}

- {this.props.renderer === "mlgljs" && + {this.props.renderer !== "ol" && <>