mapbox / mapbox/mapbox-maps-flutter

How to draw polylines from US to Asia across the Pacific

Open
#759 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

Trying to draw a polyline from from the US to Asia across the Pacific Ocean, problem is when the line hits edge of the map it draws horizontally across the entire map to the opposite edge before continuing on the path.
Screenshot_20241102-175942
Screenshot_20241102-175245

Im using a polylineAnnotationManager to create multiple lines from a list of points:

breadcrumbPolylineAnnotationManager!
        .createMulti(validBreadcrumbs.map((crumb) {
      return map.PolylineAnnotationOptions(
        geometry: map.LineString.fromPoints(
          points: crumb.convertPolylineListToMapboxPoints(),
        ),
        lineColor: crumb.getPolylineColor().value,
        lineWidth: 5.0,
      );
    }).toList());

here is the points that correspond to the transition from from negative to positive longitudes
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the polylineAnnotationManager usage and the longitude-transition points shown in the issue. Investigate how the map renders LineString coordinates when a path crosses from negative to positive longitudes; done means the US-to-Asia line follows the Pacific route without a horizontal segment across the map.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.