Skip to content

lat,lng precision #5

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

lat,lng precision #5

wants to merge 3 commits into from

Conversation

hurelhuyag
Copy link

Use case:
When dragging the map, it generates too precise lat, long. For example 107.13222175529222,47.9134491252185. Practically, I needed 7 digits after the dot. Like this: 107.1322217,47.9134491.

Proposal:
Projection.toLatLng() method should round numbers with arbitrary precision. For example in my case 7 digits.

@hurelhuyag
Copy link
Author

If this pull is accepted. I will create another pull for flutter

Like this:

MapController({
    required LatLng location,
    double zoom = 14,
    double precision = 14,
    this.projection = const EPSG4326(precision: precision),
  })  : _center = location,
        _zoom = zoom;

@xclud
Copy link
Owner

xclud commented Apr 28, 2023

Isn't it better to add LatLng.toStringWithPrecision(int precision) ?

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants