Skip to content
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] when onPositionChanged is called because of controller.move the position is before the move #1373

Closed
5 tasks done
SecretUnicorn opened this issue Sep 23, 2022 · 0 comments · Fixed by #1374
Closed
5 tasks done
Assignees
Labels
bug This issue reports broken functionality or another error

Comments

@SecretUnicorn
Copy link

What is the bug?

When moving via controller.move() the onPositionChanged position attribute does not hold the correct bounds. The southwest and northeast corner are the same. When slightly moving the map again after the move the bounds are correct.

What is the expected behaviour?

The position attribute of the controller should hold the correct bounds

How can we reproduce this issue?

FlutterMap(
      options: MapOptions(
        onPositionChanged: onMapChanged,
      ),

mapController.move(
                pointOfIntrest,
                mapController.zoom,
              );

 void onMapChanged(MapPosition position, bool gesture) {
    if (_mapChangeDebounce?.isActive ?? false) {
      _mapChangeDebounce!.cancel();
    }
    _mapChangeDebounce = Timer(
      const Duration(
        milliseconds: 500,
      ),
      () {
        Provider.of<GeoProvider>(context, listen: false)
            .fetchSearchesInBoundingBox(
          position.bounds!.southWest!,
          position.bounds!.northEast!,
        );
      },
    );

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android

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
@SecretUnicorn SecretUnicorn added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Sep 23, 2022
@JaffaKetchup JaffaKetchup added non-fatal and removed needs triage This new bug report needs reproducing and prioritizing labels Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants