mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

Polyline not rendered correctly

Open noforeignland opened this issue 1 year ago • 3 comments

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.

https://github.com/user-attachments/assets/7f638ec5-17b5-4ccf-b1ec-084552e38953

noforeignland avatar Sep 03 '24 18:09 noforeignland

@noforeignland Could you share your layer&source setup?

evil159 avatar Sep 04 '24 16:09 evil159

@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,
));

noforeignland avatar Sep 06 '24 13:09 noforeignland

@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,
));

noforeignland avatar Sep 06 '24 13:09 noforeignland