Skip to content

Commit 4b9659e

Browse files
author
Rachael Ellen
committed
fix find route button bug
1 parent 8352097 commit 4b9659e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

network_analysis/find-route/src/main/java/com/esri/samples/find_route/FindRouteSample.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@ public void start(Stage stage) {
160160
mapView = new MapView();
161161
mapView.setMap(map);
162162

163-
// enable find a route button when mapview is done loading
164-
mapView.addDrawStatusChangedListener(e -> {
165-
if (e.getDrawStatus() == DrawStatus.COMPLETED) {
166-
findButton.setDisable(false);
167-
}
168-
});
169-
170163
// set the viewpoint to San Diego (U.S.)
171164
mapView.setViewpointGeometryAsync(new Envelope(-13067866, 3843014, -13004499, 3871296, ESPG_3857));
172165

@@ -182,6 +175,10 @@ public void start(Stage stage) {
182175
routeTask.addDoneLoadingListener(() -> {
183176
if (routeTask.getLoadStatus() == LoadStatus.LOADED) {
184177
try {
178+
179+
// enable the find route button
180+
findButton.setDisable(false);
181+
185182
// get default route parameters
186183
routeParameters = routeTask.createDefaultParametersAsync().get();
187184
routeParameters.setOutputSpatialReference(ESPG_3857);

0 commit comments

Comments
 (0)