Skip to content

fix(maplibre): align map props with MapOptions - #2612

Open
miakh wants to merge 2 commits into
visgl:masterfrom
miakh:fix/2611-maplibre-nullable-props
Open

fix(maplibre): align map props with MapOptions#2612
miakh wants to merge 2 commits into
visgl:masterfrom
miakh:fix/2611-maplibre-nullable-props

Conversation

@miakh

@miakh miakh commented Aug 27, 2026

Copy link
Copy Markdown

Closes #2611.

MapLibre reactive map props now derive directly from the corresponding MapOptions fields: minZoom, maxZoom, minPitch, maxPitch, maxBounds, and renderWorldCopies.

Nullable camera constraints consistently use the native MapLibre reset behavior during initialization, rerenders, and reuseMaps. Constraint updates preserve safe min/max setter ordering without hardcoding MapLibre defaults.

Added coverage for null, explicit undefined, omitted props, reused maps, and high custom ranges. Removed the standalone consumer type-test setup in favor of the existing component and utility test suites.

Validation: TypeScript build, repository lint, and all 84 node/headless tests pass.

Comment thread docs/api-reference/maplibre/map.md Outdated
The padding in pixels around the viewport.

#### `minZoom`: number {#minzoom}
#### `minZoom`: number | null {#minzoom}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those not number/undefined/null?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — optional React props also include undefined. Updated the docs to show the full type.

Comment thread test/types/maplibre-map-props.ts Outdated
maxPitch: null
};

void mapProps;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something this project does? Also the declare above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right. This pattern is not established in the repository, so I removed it.

Comment thread test/types/tsconfig.json Outdated
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't understand this part. Like the whole "consumer test".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I removed the standalone consumer test. The types now derive directly from MapOptions, with runtime coverage in the existing test suites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Possibly accidental type deviation for Map props (react-map-gl/maplibre) in latest release

2 participants