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

Polyline not rendered correctly #675

Open
noforeignland opened this issue Sep 3, 2024 · 3 comments
Open

Polyline not rendered correctly #675

noforeignland opened this issue Sep 3, 2024 · 3 comments

Comments

@noforeignland
Copy link

noforeignland commented Sep 3, 2024

When displaying a complex polyline it only renders correctly at higher zoom levels. At lower zoom levels, sections of the line fail to render.

Problem occurs using build 2.2.1. on physical iPhone 14 Pro, and Samsung S22. Not tested on other devices.

trim.31238215-C9A5-43FF-907F-183B8019DCB3.MOV
@evil159
Copy link
Contributor

evil159 commented Sep 4, 2024

@noforeignland Could you share your layer&source setup?

@noforeignland
Copy link
Author

@noforeignland Could you share your layer&source setup?

Yes here you go:

_recordTrackSource = GeoJsonSource(
  id: recordTrackSourceId,
  data: json.encode(GeoJsonUtils.emptyFeatureCollection),
);
await mapboxMap.style.addSource(_recordTrackSource);

await mapboxMap.style.addLayer(LineLayer(
  id: recordTrackLinesLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', '\$type', 'LineString'],
  lineColor: Colors.red.value,
  lineWidth: 2.5,
));

await mapboxMap.style.addLayer(SymbolLayer(
  id: recordTrackArrowsLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', '\$type', 'LineString'],
  symbolPlacement: SymbolPlacement.LINE,
  symbolSpacing: 100,
  iconImage: 'nfl_arrow',
  iconSize: 0.5,
));

await mapboxMap.style.addLayer(CircleLayer(
  id: recordTrackPuckLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', 'terminal', true],
  circleRadius: 5,
  circleColor: Colors.white.value,
  circleStrokeColor: Colors.red.value,
  circleStrokeWidth: 3,
  minZoom: 0,
));

1 similar comment
@noforeignland
Copy link
Author

@noforeignland Could you share your layer&source setup?

Yes here you go:

_recordTrackSource = GeoJsonSource(
  id: recordTrackSourceId,
  data: json.encode(GeoJsonUtils.emptyFeatureCollection),
);
await mapboxMap.style.addSource(_recordTrackSource);

await mapboxMap.style.addLayer(LineLayer(
  id: recordTrackLinesLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', '\$type', 'LineString'],
  lineColor: Colors.red.value,
  lineWidth: 2.5,
));

await mapboxMap.style.addLayer(SymbolLayer(
  id: recordTrackArrowsLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', '\$type', 'LineString'],
  symbolPlacement: SymbolPlacement.LINE,
  symbolSpacing: 100,
  iconImage: 'nfl_arrow',
  iconSize: 0.5,
));

await mapboxMap.style.addLayer(CircleLayer(
  id: recordTrackPuckLayerId,
  sourceId: recordTrackSourceId,
  filter: ['==', 'terminal', true],
  circleRadius: 5,
  circleColor: Colors.white.value,
  circleStrokeColor: Colors.red.value,
  circleStrokeWidth: 3,
  minZoom: 0,
));

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

No branches or pull requests

2 participants