|
|
|
|
@ -141,10 +141,13 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
_lastFittedCoordinatesKey = null; // force re-fit even if the same building is viewed again
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
// Only show the loader when zones must be fetched; if they are cached the call completes
|
|
|
|
|
// before the (post-frame) dialog appears, and the dialog would never be dismissed.
|
|
|
|
|
final needsNetwork = provider.zonesList.isEmpty;
|
|
|
|
|
if (needsNetwork) Utils.showLoading(context);
|
|
|
|
|
await provider.getZoneFromPenguin();
|
|
|
|
|
if (!mounted) return;
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
if (needsNetwork) Utils.hideLoading(context);
|
|
|
|
|
// Camera fit happens in the building-outline Selector once the polygon is rendered.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -621,6 +624,8 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
if (value != null) {
|
|
|
|
|
assetProvider.selectedSite = value;
|
|
|
|
|
assetProvider.selectedBuilding = null;
|
|
|
|
|
assetProvider.selectedFloor = null;
|
|
|
|
|
getPenguinBuildings(value.id!);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|