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

Update/radarWWA #226

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions lib/src/modules/map/map_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,32 @@ class _MapBoxViewState extends ConsumerState<MapBoxView>
final ByteData plane = await rootBundle.load('assets/plane.png');
final ByteData boat = await rootBundle.load('assets/boat.png');

//fetch weather radar raster tiles from mesonet then add as a mapbox source
await mapboxMapController.addImage(
'heli',
heli.buffer.asUint8List(),
);
await mapboxMapController.addImage(
'plane',
plane.buffer.asUint8List(),
);
await mapboxMapController.addImage(
'boat',
boat.buffer.asUint8List(),
);
await mapboxMapController.setSymbolIconAllowOverlap(true);
mapboxMapController.onSymbolTapped.add(onSymbolTappedErrorWrapper);

final List<ADSB> adsbList = ref.read(adsbStreamProvider).value ?? [];
await loadADSBSymbols(adsbList);
final List<Ship> shipsList = ref.read(shipsStreamProvider).value ?? [];
await loadShipssymbols(shipsList);
final List<ActiveTFR> activeTFRs =
ref.read(activeTFRsStreamProvider).value ?? [];
await loadActiveTFRsymbols(activeTFRs);



//fetch weather radar raster tiles from mesonet then add as a mapbox source
const RasterSourceProperties weatherRadarSource = RasterSourceProperties(
tiles: [
'https://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{z}/{x}/{y}.png',
Expand Down Expand Up @@ -132,30 +156,6 @@ class _MapBoxViewState extends ConsumerState<MapBoxView>
'Warnings_Raster_Layer',
warningsLayer,
);

await mapboxMapController.addImage(
'heli',
heli.buffer.asUint8List(),
);
await mapboxMapController.addImage(
'plane',
plane.buffer.asUint8List(),
);
await mapboxMapController.addImage(
'boat',
boat.buffer.asUint8List(),
);
await mapboxMapController.setSymbolIconAllowOverlap(true);
mapboxMapController.onSymbolTapped.add(onSymbolTappedErrorWrapper);

final List<ADSB> adsbList = ref.read(adsbStreamProvider).value ?? [];
await loadADSBSymbols(adsbList);
final List<Ship> shipsList = ref.read(shipsStreamProvider).value ?? [];
await loadShipssymbols(shipsList);
final List<ActiveTFR> activeTFRs =
ref.read(activeTFRsStreamProvider).value ?? [];
await loadActiveTFRsymbols(activeTFRs);

setState(() {
hasStylesLoaded = true;
});
Expand Down