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
+19 -9
View File
@@ -15,6 +15,21 @@ type LinterError = {
message: string;
};
type EditorProps = {
parent: HTMLElement,
value: string,
lintType: LintType,
onChange: (value: string) => void,
onFocus: () => void,
onBlur: () => void,
spec?: StylePropertySpecification,
/**
* An empty optional editor means the value is unset, which is valid
*/
optional?: boolean,
};
function getDiagnosticsFromExpressionErrors(errors: LinterError[], ast: ValueNode | PropertyNode) {
const diagnostics: Diagnostic[] = [];
for (const error of errors) {
@@ -128,15 +143,7 @@ function createMaplibreExpressionLinter(spec?: StylePropertySpecification) {
};
}
export function createEditor(props: {
parent: HTMLElement,
value: string,
lintType: LintType,
onChange: (value: string) => void,
onFocus: () => void,
onBlur: () => void,
spec?: StylePropertySpecification,
}): EditorView {
export function createEditor(props: EditorProps): EditorView {
let specificLinter: (view: EditorView) => Diagnostic[] = () => [];
switch (props.lintType) {
case "style":
@@ -181,6 +188,9 @@ export function createEditor(props: {
}),
lintGutter(),
linter((view: EditorView) => {
if (props.optional && view.state.doc.toString().trim() === "") {
return [];
}
const jsonErrors = jsonParseLinter()(view);
if (jsonErrors.length > 0) {
return jsonErrors;