Skip to content

[BUG] Double bounding boxes in OverlayImageLayer cause incorrect size #1347

@JosefWN

Description

@JosefWN

What is the bug?

I have discovered a couple of edge cases where having a bounding box:

class OverlayImage extends BaseOverlayImage {
  final LatLngBounds bounds;
  // ...

... in addition to the bounding box I added to support polar projections:

Positioned buildPositionedForOverlay(FlutterMapState map) {
  // northWest is not necessarily upperLeft depending on projection
  final bounds = Bounds<num>(
    map.project(this.bounds.northWest) - map.pixelOrigin,
    map.project(this.bounds.southEast) - map.pixelOrigin,
  );
  // ...

... 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?

Trying the EPSG:3413 example reprojected in EPSG:3996

Do you have a potential solution?

In my fork I solved this by changing bounds to a List<LatLng>. This would be a breaking API change. Should I make a PR for 3.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

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions