Replies: 2 comments
-
|
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.
-
|
Could you provide a minimal working index.html as a simple example? (Instantiate a map with bearing, insert the rotated image, calculate corners.) I can take a look if the core behavior is achievable with the new map option It still won't be an elegant interface, but it might work. |
Beta Was this translation helpful? Give feedback.
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(), andmaxBoundswork perfectlyWhat Doesn't Work ❌
LngLatBoundsLikedoesn't support rotation (uses minimal axis-aligned area)maxBoundsfor rotated viewsRoot Cause
As explained in this blog post, the issue stems from:
getBounds()returns axis-aligned bounds, losing rotation informationLngLatBoundsconcept doesn't include rotation/bearingmaxBoundscannot be set for rotated rectangular areasCurrent Workaround
Using geojson-map-fit-mercator:
Problems with Workaround
maxBoundswhen 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
fitFeatureand similar functionality, but no concrete solution for production use.Beta Was this translation helpful? Give feedback.
All reactions