Skip to content

[FEATURE] Is it possible to re-make LatLng as a first-party class? #1452

@znromonk

Description

@znromonk

What do you want implemented?

LatLng used by Flutter Map is currently from the latlong2 plugin. One major limitation of the plugin is the assertion of the latitude/longitude bounds. The original leaflet JS library has it's own LatLng class and does not have bounds on latitude/longitude values and allows for wrapping based on CRS.

Eliminating the restrictions on the latitude/longitude values, opens up possibility to solve the issues #1338 and #468 which relate to the polylines across the +/-180 longitude and repeating the maps across the +/-180 longitude.

It is a relatively light codebase to port and could be made in accordance with official leaflet source.

What other alternatives are available?

I have been able to modify the latlong2 plugin code and remove the restrictions mentioned above. I also made the necessary changes to the FlutterMap code to follow the official leaflet JS with respect to wrapping the tiles.

With this I can pan across the +/-180 boundaries and also show polylines across them without splitting them up.

Can you provide any other information?

Demo:

MapPanTest.mov

Platforms Affected

Android, iOS, Web, Windows, MacOS, Linux

Severity

Annoying: Currently have to use workarounds

Requirements

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions