Replies: 1 comment
-
I don't think there's a good support for this. I think a general hook into the transform's constrain logic might be something beneficial and general enough to cover different types of constraints. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
MapLibre Bounds and Bearing Handling Issue
Problem Overview
I'm working on a Proof of Concept with MapLibre in Angular that involves placing images on a map. The application includes:
Current Implementation
The Issue
What Works ✅
getBounds()
,setBounds()
, andmaxBounds
work perfectlyWhat Doesn't Work ❌
LngLatBoundsLike
doesn't support rotation (uses minimal axis-aligned area)maxBounds
for rotated viewsRoot Cause
As explained in this blog post, the issue stems from:
getBounds()
returns axis-aligned bounds, losing rotation informationLngLatBounds
concept doesn't include rotation/bearingmaxBounds
cannot be set for rotated rectangular areasCurrent Workaround
Using geojson-map-fit-mercator:
Problems with Workaround
maxBounds
when rotation = 0Question
Is there a way to achieve native bounds and maxBounds behavior for rotated views without:
Desired behavior:
Has anyone found a clean solution for this, or are there plans to support rotated bounds natively in MapLibre?
Note: I've seen several closed PRs and issues in MapBox/Libre repos mentioning
fitFeature
and similar functionality, but no concrete solution for production use.Beta Was this translation helpful? Give feedback.
All reactions