Add font-faces, sky, roll and centerAltitude (#2189)

After: 
<img width="425" height="366" alt="image"
src="https://github.com/user-attachments/assets/f737de31-57e8-4445-b114-a5acdabb619c"
/>



## Launch Checklist

 - [x] Briefly describe the changes in this PR.
- [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:
Harel M
2026-09-27 20:05:23 +03:00
committed by GitHub
parent 2384adf517
commit 560478410a
16 changed files with 304 additions and 39 deletions
+36
View File
@@ -338,6 +338,29 @@ describe("modals", () => {
});
});
test("font faces", async () => {
const fontFaces = { "Noto Sans Regular": [{ url: "http://example.com/font.ttf", "unicode-range": ["U+1780-17FF"] }] };
await when.setTextInJsonEditor(JSON.stringify(fontFaces), "modal:settings.font-faces");
await when.click("modal:settings.name");
await then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
"font-faces": fontFaces,
});
});
test("unset font faces show an empty editor without errors", async () => {
await when.wait(1000);
await then(get.jsonEditorErrors("modal:settings.font-faces")).shouldNotExist();
await when.setTextInJsonEditor(JSON.stringify({ Font: "http://example.com/font.ttf" }), "modal:settings.font-faces");
await when.click("modal:settings.name");
await when.setTextInJsonEditor("", "modal:settings.font-faces");
await when.typeKeys("{backspace}");
await when.click("modal:settings.name");
await when.wait(1000);
await then(get.jsonEditorErrors("modal:settings.font-faces")).shouldNotExist();
await then(get.styleFromLocalStorage()).shouldNotHaveProperty("font-faces");
});
test("maptiler access token", async () => {
const apiKey = "testing123";
await when.setValue("modal:settings.maputnik:openmaptiles_access_token", apiKey);
@@ -378,11 +401,24 @@ describe("modals", () => {
await when.setValue("modal:settings.zoom", "4");
await when.setValue("modal:settings.bearing", "12");
await when.setValue("modal:settings.pitch", "30");
await when.setValue("modal:settings.roll", "15");
await when.setValue("modal:settings.center-altitude", "100");
await when.click("modal:settings.name");
await then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
zoom: 4,
bearing: 12,
pitch: 30,
roll: 15,
centerAltitude: 100,
});
});
test("sky and fog blends", async () => {
await when.setValue("modal:settings.sky-horizon-blend", "0.3");
await when.setValue("modal:settings.fog-ground-blend", "0.2");
await when.click("modal:settings.name");
await then(get.styleFromLocalStorage()).shouldDeepNestedInclude({
sky: { "sky-horizon-blend": 0.3, "fog-ground-blend": 0.2 },
});
});