From 025512921e88bdab48e5c1a51d6d0ed8be138926 Mon Sep 17 00:00:00 2001 From: abkumar Date: Thu, 1 Aug 2024 22:32:36 +0530 Subject: [PATCH] Update example apps for release 4.19.3.0 Signed-off-by: abkumar --- README.md | 2 +- examples/latest/README.md | 2 +- .../java/com/here/hellomap/MainActivity.java | 13 +- .../flutter/hello_map_app/lib/main.dart | 11 +- .../HelloMap/HelloMap/ViewController.swift | 17 +- .../Routing/Base.lproj/Main.storyboard | 28 +- .../java/com/here/routing/MainActivity.java | 3 + .../java/com/here/routing/RoutingExample.java | 23 +- .../app/src/main/res/layout/activity_main.xml | 15 + .../java/com/here/hellomap/MainActivity.java | 13 +- .../examples/venues/VenueTapController.java | 191 ++++- .../app/src/main/res/drawable/ambulance.png | Bin 0 -> 573 bytes .../app/src/main/res/drawable/bike.png | Bin 0 -> 576 bytes .../app/src/main/res/drawable/car.png | Bin 0 -> 433 bytes .../app/src/main/res/drawable/pedestrian.png | Bin 0 -> 599 bytes .../app/src/main/res/drawable/taxi.png | Bin 0 -> 537 bytes .../app/src/main/res/layout/activity_main.xml | 28 + .../main/res/layout/topology_direction.xml | 32 + .../flutter/hello_map_app/lib/main.dart | 11 +- .../indoor_map_app/assets/back-button.png | Bin 0 -> 439 bytes .../indoor_down-arrow-level-switcher.png | Bin 0 -> 696 bytes .../indoor_map_app/assets/indoor_handle.png | Bin 0 -> 761 bytes .../assets/indoor_rightaccessory.png | Bin 0 -> 483 bytes .../indoor_map_app/assets/indoor_row_icon.png | Bin 0 -> 447 bytes .../indoor_map_app/assets/indoor_rowleft.png | Bin 0 -> 2902 bytes .../indoor_map_app/assets/indoor_rowright.png | Bin 0 -> 399 bytes .../indoor_map_app/assets/indoor_spinner.png | Bin 0 -> 4178 bytes .../assets/indoor_up-arrow-level-switcher.png | Bin 0 -> 673 bytes .../assets/structure-switcher.png | Bin 0 -> 7921 bytes .../assets/topology-default.png | Bin 0 -> 1678 bytes .../assets/topology-focused.png | Bin 0 -> 3114 bytes .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../indoor_map_app/lib/drawing_switcher.dart | 119 +-- .../flutter/indoor_map_app/lib/events.dart | 18 + .../indoor_map_app/lib/level_switcher.dart | 129 +++- .../flutter/indoor_map_app/lib/main.dart | 682 +++++++++++++++--- .../lib/venue_engine_widget.dart | 162 ++++- .../lib/venue_search_controller.dart | 48 +- .../lib/venue_tap_controller.dart | 9 + .../flutter/indoor_map_app/pubspec.yaml | 1 + .../HelloMap/HelloMap/ViewController.swift | 17 +- .../img_ambulance.imageset/Contents.json | 21 + .../img_ambulance.imageset/img_ambulance.png | Bin 0 -> 697 bytes .../img_bike.imageset/Contents.json | 21 + .../img_bike.imageset/img_bike.png | Bin 0 -> 758 bytes .../img_car.imageset/Contents.json | 21 + .../img_car.imageset/img_car.png | Bin 0 -> 622 bytes .../img_pedestrian.imageset/Contents.json | 21 + .../img_pedestrian.png | Bin 0 -> 797 bytes .../img_taxi.imageset/Contents.json | 21 + .../img_taxi.imageset/img_taxi.png | Bin 0 -> 748 bytes .../IndoorMap/IndoorMap/VenueTapHandler.swift | 259 ++++++- .../Routing/Base.lproj/Main.storyboard | 28 +- 53 files changed, 1638 insertions(+), 330 deletions(-) create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/ambulance.png create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/bike.png create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/car.png create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/pedestrian.png create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/taxi.png create mode 100644 examples/latest/navigate/android/IndoorMap/app/src/main/res/layout/topology_direction.xml create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/back-button.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_down-arrow-level-switcher.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_handle.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_rightaccessory.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_row_icon.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_rowleft.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_rowright.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_spinner.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/indoor_up-arrow-level-switcher.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/structure-switcher.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/topology-default.png create mode 100644 examples/latest/navigate/flutter/indoor_map_app/assets/topology-focused.png create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_ambulance.imageset/Contents.json create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_ambulance.imageset/img_ambulance.png create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_bike.imageset/Contents.json create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_bike.imageset/img_bike.png create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_car.imageset/Contents.json create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_car.imageset/img_car.png create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_pedestrian.imageset/Contents.json create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_pedestrian.imageset/img_pedestrian.png create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_taxi.imageset/Contents.json create mode 100644 examples/latest/navigate/ios/IndoorMap/IndoorMap/Assets.xcassets/img_taxi.imageset/img_taxi.png diff --git a/README.md b/README.md index 5b7de984..d3d2d57c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for > For now, the _Navigate Edition_ is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials. -## List of Available Example Apps (Version 4.19.2.0) +## List of Available Example Apps (Version 4.19.3.0) - **HelloMap**: Shows the classic 'Hello World'. - **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only). diff --git a/examples/latest/README.md b/examples/latest/README.md index 9d1a8c06..46fed70f 100644 --- a/examples/latest/README.md +++ b/examples/latest/README.md @@ -1,4 +1,4 @@ -This folder contains the HERE SDK examples apps for version: 4.19.2.0 +This folder contains the HERE SDK examples apps for version: 4.19.3.0 - HERE SDK for Android ([Lite Edition](lite/android/), [Explore Edition](explore/android/), [Navigate Edition](navigate/android/)) - HERE SDK for iOS ([Lite Edition](lite/ios/), [Explore Edition](explore/ios/), [Navigate Edition](navigate/ios/)) diff --git a/examples/latest/explore/android/HelloMap/app/src/main/java/com/here/hellomap/MainActivity.java b/examples/latest/explore/android/HelloMap/app/src/main/java/com/here/hellomap/MainActivity.java index c80ca083..ae0b0338 100644 --- a/examples/latest/explore/android/HelloMap/app/src/main/java/com/here/hellomap/MainActivity.java +++ b/examples/latest/explore/android/HelloMap/app/src/main/java/com/here/hellomap/MainActivity.java @@ -106,15 +106,16 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis } private void loadMapScene() { + // The camera can be configured before or after a scene is loaded. + double distanceInMeters = 1000 * 10; + MapMeasure mapMeasureZoom = new MapMeasure(MapMeasure.Kind.DISTANCE, distanceInMeters); + mapView.getCamera().lookAt(new GeoCoordinates(52.530932, 13.384915), mapMeasureZoom); + // Load a scene from the HERE SDK to render the map with a map scheme. mapView.getMapScene().loadScene(MapScheme.NORMAL_DAY, new MapScene.LoadSceneCallback() { @Override public void onLoadScene(@Nullable MapError mapError) { - if (mapError == null) { - double distanceInMeters = 1000 * 10; - MapMeasure mapMeasureZoom = new MapMeasure(MapMeasure.Kind.DISTANCE, distanceInMeters); - mapView.getCamera().lookAt(new GeoCoordinates(52.530932, 13.384915), mapMeasureZoom); - } else { + if (mapError != null) { Log.d(TAG, "Loading map failed: mapError: " + mapError.name()); } } @@ -145,7 +146,7 @@ protected void onSaveInstanceState(@NonNull Bundle outState) { mapView.onSaveInstanceState(outState); super.onSaveInstanceState(outState); } - + private void disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. diff --git a/examples/latest/explore/flutter/hello_map_app/lib/main.dart b/examples/latest/explore/flutter/hello_map_app/lib/main.dart index c1180374..fd15852a 100644 --- a/examples/latest/explore/flutter/hello_map_app/lib/main.dart +++ b/examples/latest/explore/flutter/hello_map_app/lib/main.dart @@ -56,15 +56,16 @@ class MyApp extends StatelessWidget { } void _onMapCreated(HereMapController hereMapController) { + // The camera can be configured before or after a scene is loaded. + const double distanceToEarthInMeters = 8000; + MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters); + hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom); + + // Load the map scene using a map scheme to render the map with. hereMapController.mapScene.loadSceneForMapScheme(MapScheme.normalDay, (MapError? error) { if (error != null) { print('Map scene not loaded. MapError: ${error.toString()}'); - return; } - - const double distanceToEarthInMeters = 8000; - MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters); - hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom); }); } } diff --git a/examples/latest/explore/ios/HelloMap/HelloMap/ViewController.swift b/examples/latest/explore/ios/HelloMap/HelloMap/ViewController.swift index 1d02dd73..7087536b 100644 --- a/examples/latest/explore/ios/HelloMap/HelloMap/ViewController.swift +++ b/examples/latest/explore/ios/HelloMap/HelloMap/ViewController.swift @@ -23,7 +23,7 @@ import UIKit class ViewController: UIViewController { var mapView : MapView! - + override func viewDidLoad() { super.viewDidLoad() @@ -31,21 +31,20 @@ class ViewController: UIViewController { mapView = MapView(frame: view.bounds) view.addSubview(mapView) + // The camera can be configured before or after a scene is loaded. + let camera = mapView.camera + let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) + camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) + // Load the map scene using a map scheme to render the map with. mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) } // Completion handler when loading a map scene. private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return + if let error = mapError { + print("Error: Map scene not loaded, \(error)") } - - // Configure the map. - let camera = mapView.camera - let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) - camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) } override func didReceiveMemoryWarning() { diff --git a/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard index d1e17998..fa2f536a 100644 --- a/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard +++ b/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard @@ -1,11 +1,9 @@ - - - - + + - + @@ -21,12 +19,24 @@ + + + - - - + - - -