Invoke setter with default when prop missing#2560
Conversation
|
|
||
| const DEFAULT_STYLE = {version: 8, sources: {}, layers: []} as StyleSpecification; | ||
|
|
||
| const DEFAULT_SETTINGS = { |
There was a problem hiding this comment.
Where do these defaults come from, and should they be applied anywhere else to keep systems in sync?
There was a problem hiding this comment.
I looked them up in the docs, they seem pretty reasonable. Only maxPitch is a bit weird, in that it depends on the library version. It would be nice if they could be extracted from the map lib at runtime, but I didn't see a way to do that
| minPitch: 0, | ||
| maxPitch: 85, | ||
| maxBounds: [-180, -85.051129, 180, 85.051129], | ||
| projection: 'mercator', |
There was a problem hiding this comment.
Is projection in maplibre? Might want to cross reference https://www.maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/
There was a problem hiding this comment.
There was a problem hiding this comment.
That's a different API I think. That's the JSON style spec whereas this is the MapOptions for the js library
Closes #2559