@@ -11,6 +11,7 @@ import LayerSwitcher from "./components/LayerSwitcher";
1111import FeatureInfo from "./components/FeatureInfo" ;
1212import Map from "./common/Map" ;
1313import { Feature , MapConfig } from "./models" ;
14+ import OngoingFetchInfo from "./components/OngoingFetchInfo" ;
1415
1516const drawWidth = "400px" ;
1617
@@ -36,6 +37,7 @@ interface AppState {
3637 open : boolean ;
3738 mapConfig : MapConfig | null ;
3839 features : Feature [ ] ;
40+ ongoingFeatureFetches : Set < string > ;
3941}
4042
4143class App extends React . Component < AppProps , AppState > {
@@ -47,6 +49,7 @@ class App extends React.Component<AppProps, AppState> {
4749 open : false ,
4850 mapConfig : null ,
4951 features : [ ] ,
52+ ongoingFeatureFetches : new Set < string > ( ) ,
5053 } ;
5154 }
5255
@@ -57,12 +60,15 @@ class App extends React.Component<AppProps, AppState> {
5760 } ) ;
5861 Map . initialize ( this . mapId , mapConfig ) ;
5962 Map . registerFeatureInfoCallback ( ( features : Feature [ ] ) => this . setState ( { features } ) ) ;
63+ Map . registerOngoingFeatureFetchesCallback ( ( fetches : Set < string > ) =>
64+ this . setState ( { ongoingFeatureFetches : fetches } ) ,
65+ ) ;
6066 } ) ;
6167 }
6268
6369 render ( ) {
6470 const { classes } = this . props ;
65- const { open, mapConfig, features } = this . state ;
71+ const { open, mapConfig, features, ongoingFeatureFetches } = this . state ;
6672 return (
6773 < React . StrictMode >
6874 < div className = "App" >
@@ -80,6 +86,9 @@ class App extends React.Component<AppProps, AppState> {
8086 } }
8187 />
8288 ) }
89+ { ongoingFeatureFetches . size > 0 && (
90+ < OngoingFetchInfo layerIdentifiers = { ongoingFeatureFetches } > </ OngoingFetchInfo >
91+ ) }
8392 < Fab
8493 size = "medium"
8594 color = "primary"
0 commit comments