mirror of
https://github.com/maputnik/editor.git
synced 2026-10-13 06:23:43 +00:00
feat: Add ability to control the max zoom of the map (#2201)
- Resolves #2202 ## Launch Checklist The map max zoom was increased to 24 without the ability to change it. - https://github.com/maplibre/maputnik/issues/593 The default is 22 for all maplibre instances if you don't override it in your code. The zoom levels to over scale is dependent on max zoom, which can affect how the map looks. This PR adds the ability to change this. This was added to the debug dialog: <img width="446" height="446" alt="image" src="https://github.com/user-attachments/assets/ea68c392-309f-4476-8922-790670762d56" /> - [x] Briefly describe the changes in this PR. - [x] Link to related issues. - [x] Include before/after visuals or gifs if this PR includes visual changes. - [x] Write tests for all new functionality. - [x] Add an entry to `CHANGELOG.md` under the `## main` section.
This commit is contained in:
@@ -64,6 +64,30 @@ describe("modals", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("debug", () => {
|
||||
beforeEach(async () => {
|
||||
await when.setStyle("zoom_7_center_0_51");
|
||||
await then(get.locationHash()).shouldInclude("#7/51/0");
|
||||
await when.typeKeys("!");
|
||||
});
|
||||
|
||||
test("max zoom is empty until the user sets it", async () => {
|
||||
await then(get.elementByTestId("modal:debug.max-zoom")).shouldHaveValue("");
|
||||
});
|
||||
|
||||
test("lowering the max zoom zooms the map out to it", async () => {
|
||||
await when.setValue("modal:debug.max-zoom", "3");
|
||||
await then(get.locationHash()).shouldInclude("#3/51/0");
|
||||
});
|
||||
|
||||
test("typing a multi-digit max zoom keeps the map in place", async () => {
|
||||
await when.type("modal:debug.max-zoom", "{selectall}{backspace}22");
|
||||
// Let the debounced update reach the map
|
||||
await when.wait(1000);
|
||||
await then(get.locationHash()).shouldInclude("#7/51/0");
|
||||
});
|
||||
});
|
||||
|
||||
describe("export", () => {
|
||||
beforeEach(async () => {
|
||||
await when.click("nav:export");
|
||||
|
||||
Reference in New Issue
Block a user