Skip to content

Commit b8ad5b9

Browse files
authored
chore: make style generation code work for sky, projection and light as well (#7919)
* Make style generation code work for sky, projection and light as well. * Move types to the right place. * Add changelog * Remove experimental node flags * Switch to use vec3 instead of a new type. * Improve types. * Remove dead code * Improve types a bit, use union.
1 parent 25d4da2 commit b8ad5b9

12 files changed

Lines changed: 279 additions & 273 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## main
22
### ✨ Features and improvements
33
- Improve runtime error warnings to point at the offending style location (e.g. `layers[3].paint.line-color`, `layers[3].filter`) instead of just logging the bare error message ([#7869](https://github.com/maplibre/maplibre-gl-js/pull/7869)) (by [@CommanderStorm](https://github.com/CommanderStorm))
4+
- ⚠️ Interpolate the light position in spherical coordinates instead of cartesian ones, so that a transition keeps its radial distance. ([#7919](https://github.com/maplibre/maplibre-gl-js/pull/7919)) (by [@HarelM](https://github.com/HarelM))
45
- _...Add new stuff here..._
56

67
### 🐞 Bug fixes

build/generate-struct-arrays.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'use strict';
1010

1111
import * as fs from 'fs';
12-
import * as util from '../src/util/util.ts';
12+
import {extend} from '../src/util/util.ts';
1313
import {createLayout, viewTypes} from '../src/util/struct_array.ts';
1414
import type {ViewType, StructArrayLayout} from '../src/util/struct_array.ts';
1515

@@ -60,7 +60,7 @@ function normalizeMembers(members, usedTypes) {
6060
usedTypes.add(member.type);
6161
}
6262

63-
return util.extend(member, {
63+
return extend(member, {
6464
size: sizeOf(member.type),
6565
view: member.type.toLowerCase()
6666
});
@@ -103,7 +103,7 @@ function createStructArrayLayoutType({members, size, alignment}) {
103103
if (!alignment || alignment === 1) members = members.reduce((memo, member) => {
104104
if (memo.length > 0 && memo[memo.length - 1].type === member.type) {
105105
const last = memo[memo.length - 1];
106-
return memo.slice(0, -1).concat(util.extend({}, last, {
106+
return memo.slice(0, -1).concat(extend({}, last, {
107107
components: last.components + member.components,
108108
}));
109109
}

0 commit comments

Comments
 (0)