-
-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Double bounding boxes in OverlayImageLayer
cause incorrect size
#1347
Comments
OverlayImageLayer
cause OverlayImageLayer
cause incorrect size
Hi @JosefWN, |
Same problem. Here is a minimal snippet (EPSG:3996) reproducing it: final topLeft = LatLng(74.60299799700462, -170.9997690385578);
final bottomRight = LatLng(77.77365255354441, 91.91349368273093);
final bounds = LatLngBounds(topLeft, bottomRight);
final projBounds1 = Bounds<num>(
map.project(bounds.northWest) - map.pixelOrigin,
map.project(bounds.southEast) - map.pixelOrigin,
);
final projBounds2 = Bounds<num>(
map.project(topLeft) - map.pixelOrigin,
map.project(bottomRight) - map.pixelOrigin,
);
final bounds2 = LatLngBounds.fromPoints([topLeft, bottomRight]);
final projBounds3 = Bounds<num>(
map.project(bounds2.northWest) - map.pixelOrigin,
map.project(bounds2.southEast) - map.pixelOrigin,
);
print('projBounds1 (current):');
print('topLeft: ${projBounds1.topLeft}');
print('bottomRight: ${projBounds1.bottomRight}');
print('topLeft: ${map.unproject(projBounds1.topLeft + map.pixelOrigin)}');
print('bottomRight: ${map.unproject(projBounds1.bottomRight + map.pixelOrigin)}');
print('projBounds2 (proposed):');
print('topLeft: ${projBounds2.topLeft}');
print('bottomRight: ${projBounds2.bottomRight}');
print('topLeft: ${map.unproject(projBounds2.topLeft + map.pixelOrigin)}');
print('bottomRight: ${map.unproject(projBounds2.bottomRight + map.pixelOrigin)}');
print('projBounds3 (LatLngBounds.fromPoints):');
print('topLeft: ${projBounds3.topLeft}');
print('bottomRight: ${projBounds3.bottomRight}');
print('topLeft: ${map.unproject(projBounds3.topLeft + map.pixelOrigin)}');
print('bottomRight: ${map.unproject(projBounds3.bottomRight + map.pixelOrigin)}'); This returns:
It seems some corner coordinates are swapped around in the assumption that |
(preventing staleness from setting in) Thanks, we'll have a look at this when we get a moment. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
What is the bug?
I have discovered a couple of edge cases where having a bounding box:
... in addition to the bounding box I added to support polar projections:
... will create a bounding box of incorrect size / incorrect position. Not way off, but noticeably.
What is the expected behaviour?
Image positioning issues should not occur.
How can we reproduce this issue?
Do you have a potential solution?
In my fork I solved this by changing
bounds
to aList<LatLng>
. This would be a breaking API change. Should I make a PR for3.0.0
?Can you provide any other information?
No response
Platforms Affected
MacOS
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
Frequency
Consistently: Always occurs at the same time and location
Requirements
flutter doctor
finds no relevant issuesThe text was updated successfully, but these errors were encountered: