File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/com/esri/samples/ogc/wms_layer_url Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2020import java .util .List ;
2121
2222import javafx .application .Application ;
23+ import javafx .geometry .Pos ;
2324import javafx .scene .Scene ;
2425import javafx .scene .control .Alert ;
26+ import javafx .scene .control .ProgressIndicator ;
2527import javafx .scene .layout .StackPane ;
2628import javafx .stage .Stage ;
2729
@@ -56,6 +58,10 @@ public void start(Stage stage) {
5658 mapView = new MapView ();
5759 mapView .setMap (map );
5860
61+ ProgressIndicator progressIndicator = new ProgressIndicator ();
62+ progressIndicator .setProgress (ProgressIndicator .INDETERMINATE_PROGRESS );
63+ progressIndicator .setMaxSize (25 , 25 );
64+
5965 // create a WMS layer
6066 List <String > wmsLayerNames = Collections .singletonList ("0" );
6167 String url = "https://certmapper.cr.usgs.gov/arcgis/services/geology/africa/MapServer/WMSServer?request=GetCapabilities&service=WMS" ;
@@ -69,11 +75,13 @@ public void start(Stage stage) {
6975 Alert alert = new Alert (Alert .AlertType .ERROR , "Failed to load WMS layer" );
7076 alert .show ();
7177 }
78+ progressIndicator .setVisible (false );
7279 });
7380 wmsLayer .loadAsync ();
7481
7582 // add the map view to stack pane
76- stackPane .getChildren ().addAll (mapView );
83+ stackPane .getChildren ().addAll (mapView , progressIndicator );
84+ StackPane .setAlignment (progressIndicator , Pos .CENTER );
7785 } catch (Exception e ) {
7886 // on any error, display the stack trace.
7987 e .printStackTrace ();
You can’t perform that action at this time.
0 commit comments