File tree Expand file tree Collapse file tree
Maps3DSamples/ApiDemos/java-app/src/main/java/com/example/maps3djava/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ public final Camera getInitialCamera() {
118118 // Background Executors
119119 private final ExecutorService executorService = Executors .newSingleThreadExecutor ();
120120 private final Handler mainHandler = new Handler (Looper .getMainLooper ());
121- private Future <RouteData > routeFetchFuture ;
122121
123122 @ Override
124123 protected void onCreate (Bundle savedInstanceState ) {
@@ -241,8 +240,7 @@ private void loadAndRenderRouteAsync(GoogleMap3D googleMap3D) {
241240 if (apiKey .isEmpty () || apiKey .contains ("YOUR_API_KEY" )) {
242241 throw new Exception ("Invalid or missing API Key" );
243242 }
244- routeFetchFuture = executorService .submit (routeRepository .fetchRouteCallable (apiKey , origin , destination ));
245- RouteData routeData = routeFetchFuture .get ();
243+ RouteData routeData = routeRepository .fetchRouteCallable (apiKey , origin , destination ).call ();
246244 decoded = PolyUtil .decode (routeData .getEncodedPolyline ());
247245 } catch (Exception e ) {
248246 Log .w (getTAG (), "Routes API fetch failed (" + e .getLocalizedMessage () + "). Falling back to pre-baked Oahu mountain route." );
You can’t perform that action at this time.
0 commit comments