diff --git a/README.md b/README.md index a4c8f782..b62d1726 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.16.2.0) +## List of Available Example Apps (Version 4.16.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 ec143f08..305cb55c 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.16.2.0 +This folder contains the HERE SDK examples apps for version: 4.16.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/flutter/camera_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/camera_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/camera_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/camera_keyframe_tracks_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/camera_keyframe_tracks_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/camera_keyframe_tracks_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart b/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart index 0c374958..750333ca 100644 --- a/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart +++ b/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart @@ -40,7 +40,7 @@ class CameraKeyframeTracksExample { try { mapCameraAnimation = MapCameraAnimationFactory.createAnimationFromKeyframeTracks(mapCameraKeyframeTracks!); } on MapCameraKeyframeTrackInstantiationException catch (e) { - print(_tag + "Error occured: " + e.error.name); + print(_tag + "Error occurred: " + e.error.name); return; } diff --git a/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart b/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart index 93de6e39..17b70481 100644 --- a/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart +++ b/examples/latest/explore/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart @@ -58,10 +58,19 @@ class RouteCalculator { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20.0; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + MapPolyline? routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } } diff --git a/examples/latest/explore/flutter/custom_map_styles_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/custom_map_styles_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/custom_map_styles_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/custom_raster_layers_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/custom_raster_layers_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/custom_raster_layers_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/ev_routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/ev_routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/ev_routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/ev_routing_app/lib/EVRoutingExample.dart b/examples/latest/explore/flutter/ev_routing_app/lib/EVRoutingExample.dart index dbabed49..cd6fe338 100644 --- a/examples/latest/explore/flutter/ev_routing_app/lib/EVRoutingExample.dart +++ b/examples/latest/explore/flutter/ev_routing_app/lib/EVRoutingExample.dart @@ -340,14 +340,23 @@ class EVRoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } if (_startGeoCoordinates == null || _destinationGeoCoordinates == null) { return; diff --git a/examples/latest/explore/flutter/gestures_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/gestures_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/gestures_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/hello_map_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/hello_map_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/hello_map_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/map_items_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/map_items_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/map_items_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/map_items_app/lib/MapObjectsExample.dart b/examples/latest/explore/flutter/map_items_app/lib/MapObjectsExample.dart index 77d6ab24..b7585d2f 100644 --- a/examples/latest/explore/flutter/map_items_app/lib/MapObjectsExample.dart +++ b/examples/latest/explore/flutter/map_items_app/lib/MapObjectsExample.dart @@ -112,12 +112,19 @@ class MapObjectsExample { double widthInPixels = 20; Color lineColor = Color.fromARGB(160, 0, 144, 138); - MapPolyline mapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - lineColor, - LineCap.round)); + MapPolyline? mapPolyline; + try { + mapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + lineColor, + LineCap.round)); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + } return mapPolyline; } diff --git a/examples/latest/explore/flutter/public_transit_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/public_transit_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/public_transit_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart b/examples/latest/explore/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart index fddc2bc1..48f8c183 100644 --- a/examples/latest/explore/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart +++ b/examples/latest/explore/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart @@ -136,14 +136,23 @@ class PublicTransportRoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } GeoCoordinates _createRandomGeoCoordinatesInViewport() { diff --git a/examples/latest/explore/flutter/routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/routing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/routing_app/lib/RoutingExample.dart b/examples/latest/explore/flutter/routing_app/lib/RoutingExample.dart index e1ea75c9..f7048fe2 100644 --- a/examples/latest/explore/flutter/routing_app/lib/RoutingExample.dart +++ b/examples/latest/explore/flutter/routing_app/lib/RoutingExample.dart @@ -174,14 +174,23 @@ class RoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } // Optionally, render traffic on route. _showTrafficOnRoute(route); @@ -203,15 +212,23 @@ class RoutingExample { continue; } double widthInPixels = 10; - MapPolyline trafficSpanMapPolyline = new MapPolyline.withRepresentation( - span.geometry, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - lineColor, - LineCap.round)); - - _hereMapController.mapScene.addMapPolyline(trafficSpanMapPolyline); - _mapPolylines.add(trafficSpanMapPolyline); + MapPolyline trafficSpanMapPolyline; + try { + trafficSpanMapPolyline = new MapPolyline.withRepresentation( + span.geometry, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + lineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(trafficSpanMapPolyline); + _mapPolylines.add(trafficSpanMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } } } diff --git a/examples/latest/explore/flutter/search_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/search_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/search_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/traffic_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/traffic_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/traffic_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/explore/flutter/traffic_app/lib/TrafficExample.dart b/examples/latest/explore/flutter/traffic_app/lib/TrafficExample.dart index 4e069f63..42231d92 100644 --- a/examples/latest/explore/flutter/traffic_app/lib/TrafficExample.dart +++ b/examples/latest/explore/flutter/traffic_app/lib/TrafficExample.dart @@ -139,15 +139,23 @@ class TrafficExample { // Show traffic incident as polyline. double widthInPixels = 20; Color polylineColor = const Color.fromARGB(120, 0, 0, 0); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylineList.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylineList.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } void _queryForIncidents(GeoCoordinates centerCoordinates) { diff --git a/examples/latest/explore/flutter/unit_testing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/latest/explore/flutter/unit_testing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..0801eba4 --- /dev/null +++ b/examples/latest/explore/flutter/unit_testing_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,24 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new com.here.here_sdk.HereSdkPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin here_sdk, com.here.here_sdk.HereSdkPlugin", e); + } + } +} diff --git a/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationExample.java b/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationExample.java index 9cc42af9..88c46a62 100644 --- a/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationExample.java +++ b/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationExample.java @@ -97,8 +97,8 @@ public void startLocationProvider() { private void prefetchMapData(GeoCoordinates currentGeoCoordinates) { // Prefetches map data around the provided location with a radius of 2 km into the map cache. - // For the best experience, prefetchAroundLocation() should be called as early as possible. - double radiusInMeters = 10.0; + // For the best experience, prefetchAroundLocationWithRadius() should be called as early as possible. + double radiusInMeters = 2000.0; routePrefetcher.prefetchAroundLocationWithRadius(currentGeoCoordinates, radiusInMeters); // Prefetches map data within a corridor along the route that is currently set to the provided Navigator instance. // This happens continuously in discrete intervals. diff --git a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart index 0c374958..750333ca 100644 --- a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart +++ b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/CameraKeyframeTracksExample.dart @@ -40,7 +40,7 @@ class CameraKeyframeTracksExample { try { mapCameraAnimation = MapCameraAnimationFactory.createAnimationFromKeyframeTracks(mapCameraKeyframeTracks!); } on MapCameraKeyframeTrackInstantiationException catch (e) { - print(_tag + "Error occured: " + e.error.name); + print(_tag + "Error occurred: " + e.error.name); return; } diff --git a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart index 93de6e39..17b70481 100644 --- a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart +++ b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/lib/helper/RouteCalculator.dart @@ -58,10 +58,19 @@ class RouteCalculator { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20.0; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + MapPolyline? routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } } diff --git a/examples/latest/navigate/flutter/ev_routing_app/lib/EVRoutingExample.dart b/examples/latest/navigate/flutter/ev_routing_app/lib/EVRoutingExample.dart index dbabed49..cd6fe338 100644 --- a/examples/latest/navigate/flutter/ev_routing_app/lib/EVRoutingExample.dart +++ b/examples/latest/navigate/flutter/ev_routing_app/lib/EVRoutingExample.dart @@ -340,14 +340,23 @@ class EVRoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } if (_startGeoCoordinates == null || _destinationGeoCoordinates == null) { return; diff --git a/examples/latest/navigate/flutter/hiking_diary_app/lib/HikingApp.dart b/examples/latest/navigate/flutter/hiking_diary_app/lib/HikingApp.dart index 4ed08d79..587b2576 100644 --- a/examples/latest/navigate/flutter/hiking_diary_app/lib/HikingApp.dart +++ b/examples/latest/navigate/flutter/hiking_diary_app/lib/HikingApp.dart @@ -214,13 +214,22 @@ class HikingApp implements LocationListener, LocationStatusListener { clearMap(); double widthInPixels = 20.0; Color polylineColor = const Color.fromARGB(0, 56, 54, 63); - MapPolyline myPathMapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - mapView.mapScene.addMapPolyline(myPathMapPolyline!); + MapPolyline myPathMapPolyline; + try { + myPathMapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + mapView.mapScene.addMapPolyline(myPathMapPolyline!); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } MapPolyline _updateTravelledPath() { diff --git a/examples/latest/navigate/flutter/hiking_diary_app/lib/positioning/HEREPositioningVisualizer.dart b/examples/latest/navigate/flutter/hiking_diary_app/lib/positioning/HEREPositioningVisualizer.dart index 49e221ee..cb5abbe9 100644 --- a/examples/latest/navigate/flutter/hiking_diary_app/lib/positioning/HEREPositioningVisualizer.dart +++ b/examples/latest/navigate/flutter/hiking_diary_app/lib/positioning/HEREPositioningVisualizer.dart @@ -99,12 +99,20 @@ class HerePositioningVisualizer { void _addMapPolyline(GeoPolyline geoPolyline) { double widthInPixels = 5.0; Color polylineColor = const Color.fromARGB(0, 56, 54, 63); - mapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.densityIndependentPixels, widthInPixels), - polylineColor, - LineCap.round)); + try { + mapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.densityIndependentPixels, widthInPixels), + polylineColor, + LineCap.round)); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } mapView.mapScene.addMapPolyline(mapPolyline!); } diff --git a/examples/latest/navigate/flutter/map_items_app/lib/MapObjectsExample.dart b/examples/latest/navigate/flutter/map_items_app/lib/MapObjectsExample.dart index 77d6ab24..b7585d2f 100644 --- a/examples/latest/navigate/flutter/map_items_app/lib/MapObjectsExample.dart +++ b/examples/latest/navigate/flutter/map_items_app/lib/MapObjectsExample.dart @@ -112,12 +112,19 @@ class MapObjectsExample { double widthInPixels = 20; Color lineColor = Color.fromARGB(160, 0, 144, 138); - MapPolyline mapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - lineColor, - LineCap.round)); + MapPolyline? mapPolyline; + try { + mapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + lineColor, + LineCap.round)); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + } return mapPolyline; } diff --git a/examples/latest/navigate/flutter/navigation_app/lib/AppLogic.dart b/examples/latest/navigate/flutter/navigation_app/lib/AppLogic.dart index 6ee533db..9b78c6c8 100644 --- a/examples/latest/navigate/flutter/navigation_app/lib/AppLogic.dart +++ b/examples/latest/navigate/flutter/navigation_app/lib/AppLogic.dart @@ -184,12 +184,21 @@ class AppLogic { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _calculatedRouteMapPolyline = routeMapPolyline; - _hereMapController.mapScene.addMapPolyline(_calculatedRouteMapPolyline!); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation(routeGeoPolyline, MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _calculatedRouteMapPolyline = routeMapPolyline; + _hereMapController.mapScene.addMapPolyline(_calculatedRouteMapPolyline!); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } bool _determineRouteWaypoints(bool isSimulated) { diff --git a/examples/latest/navigate/flutter/navigation_app/lib/NavigationExample.dart b/examples/latest/navigate/flutter/navigation_app/lib/NavigationExample.dart index ff60d0e8..d98fa418 100644 --- a/examples/latest/navigate/flutter/navigation_app/lib/NavigationExample.dart +++ b/examples/latest/navigate/flutter/navigation_app/lib/NavigationExample.dart @@ -83,8 +83,8 @@ class NavigationExample { void prefetchMapData(GeoCoordinates currentGeoCoordinates) { // Prefetches map data around the provided location with a radius of 2 km into the map cache. - // For the best experience, prefetchAroundLocation() should be called as early as possible. - double radiusInMeters = 10.0; + // For the best experience, prefetchAroundLocationWithRadius() should be called as early as possible. + double radiusInMeters = 2000.0; _routePrefetcher.prefetchAroundLocationWithRadius(currentGeoCoordinates, radiusInMeters); // Prefetches map data within a corridor along the route that is currently set to the provided Navigator instance. // This happens continuously in discrete intervals. diff --git a/examples/latest/navigate/flutter/offline_maps_app/lib/OfflineMapsExample.dart b/examples/latest/navigate/flutter/offline_maps_app/lib/OfflineMapsExample.dart index 74d9a3c7..5fbb6545 100644 --- a/examples/latest/navigate/flutter/offline_maps_app/lib/OfflineMapsExample.dart +++ b/examples/latest/navigate/flutter/offline_maps_app/lib/OfflineMapsExample.dart @@ -77,6 +77,7 @@ class OfflineMapsExample { } void _performUpdateChecks() { + _logCurrentSDKVersion(); _logCurrentMapVersion(); // Checks if map updates are available for any of the already downloaded maps. @@ -384,6 +385,10 @@ class OfflineMapsExample { } } + _logCurrentSDKVersion() { + print("HERE SDK version: " + SDKBuildInformation.sdkVersion().versionName); + } + _logCurrentMapVersion() { if (_mapUpdater == null) { _showDialog("Note", "MapUpdater instance not ready. Try again."); diff --git a/examples/latest/navigate/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart b/examples/latest/navigate/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart index fddc2bc1..48f8c183 100644 --- a/examples/latest/navigate/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart +++ b/examples/latest/navigate/flutter/public_transit_app/lib/PublicTransportRoutingExample.dart @@ -136,14 +136,23 @@ class PublicTransportRoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } GeoCoordinates _createRandomGeoCoordinatesInViewport() { diff --git a/examples/latest/navigate/flutter/routing_app/lib/RoutingExample.dart b/examples/latest/navigate/flutter/routing_app/lib/RoutingExample.dart index e1ea75c9..f7048fe2 100644 --- a/examples/latest/navigate/flutter/routing_app/lib/RoutingExample.dart +++ b/examples/latest/navigate/flutter/routing_app/lib/RoutingExample.dart @@ -174,14 +174,23 @@ class RoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } // Optionally, render traffic on route. _showTrafficOnRoute(route); @@ -203,15 +212,23 @@ class RoutingExample { continue; } double widthInPixels = 10; - MapPolyline trafficSpanMapPolyline = new MapPolyline.withRepresentation( - span.geometry, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - lineColor, - LineCap.round)); - - _hereMapController.mapScene.addMapPolyline(trafficSpanMapPolyline); - _mapPolylines.add(trafficSpanMapPolyline); + MapPolyline trafficSpanMapPolyline; + try { + trafficSpanMapPolyline = new MapPolyline.withRepresentation( + span.geometry, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + lineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(trafficSpanMapPolyline); + _mapPolylines.add(trafficSpanMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } } } diff --git a/examples/latest/navigate/flutter/routing_hybrid_app/lib/RoutingExample.dart b/examples/latest/navigate/flutter/routing_hybrid_app/lib/RoutingExample.dart index ed11646f..0a509cd5 100644 --- a/examples/latest/navigate/flutter/routing_hybrid_app/lib/RoutingExample.dart +++ b/examples/latest/navigate/flutter/routing_hybrid_app/lib/RoutingExample.dart @@ -205,14 +205,23 @@ class RoutingExample { GeoPolyline routeGeoPolyline = route.geometry; double widthInPixels = 20; Color polylineColor = const Color.fromARGB(160, 0, 144, 138); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - routeGeoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylines.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + routeGeoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylines.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } GeoCoordinates startGeoCoordinates = route.geometry.vertices.first; GeoCoordinates destinationGeoCoordinates = route.geometry.vertices.last; diff --git a/examples/latest/navigate/flutter/traffic_app/lib/TrafficExample.dart b/examples/latest/navigate/flutter/traffic_app/lib/TrafficExample.dart index 4e069f63..42231d92 100644 --- a/examples/latest/navigate/flutter/traffic_app/lib/TrafficExample.dart +++ b/examples/latest/navigate/flutter/traffic_app/lib/TrafficExample.dart @@ -139,15 +139,23 @@ class TrafficExample { // Show traffic incident as polyline. double widthInPixels = 20; Color polylineColor = const Color.fromARGB(120, 0, 0, 0); - MapPolyline routeMapPolyline = MapPolyline.withRepresentation( - geoPolyline, - MapPolylineSolidRepresentation( - MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), - polylineColor, - LineCap.round)); - - _hereMapController.mapScene.addMapPolyline(routeMapPolyline); - _mapPolylineList.add(routeMapPolyline); + MapPolyline routeMapPolyline; + try { + routeMapPolyline = MapPolyline.withRepresentation( + geoPolyline, + MapPolylineSolidRepresentation( + MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels), + polylineColor, + LineCap.round)); + _hereMapController.mapScene.addMapPolyline(routeMapPolyline); + _mapPolylineList.add(routeMapPolyline); + } on MapPolylineRepresentationInstantiationException catch (e) { + print("MapPolylineRepresentation Exception:" + e.error.name); + return; + } on MapMeasureDependentRenderSizeInstantiationException catch (e) { + print("MapMeasureDependentRenderSize Exception:" + e.error.name); + return; + } } void _queryForIncidents(GeoCoordinates centerCoordinates) { diff --git a/examples/latest/navigate/ios/Navigation/Navigation/NavigationExample.swift b/examples/latest/navigate/ios/Navigation/Navigation/NavigationExample.swift index 6d50f136..5f2fa37d 100644 --- a/examples/latest/navigate/ios/Navigation/Navigation/NavigationExample.swift +++ b/examples/latest/navigate/ios/Navigation/Navigation/NavigationExample.swift @@ -76,7 +76,8 @@ class NavigationExample : DynamicRoutingDelegate { private func prefetchMapData(currentGeoCoordinates: GeoCoordinates) { // Prefetches map data around the provided location with a radius of 2 km into the map cache. - routePrefetcher.prefetchAroundLocationWithRadius(currentLocation: currentGeoCoordinates, radiusInMeters: 20.0) + // For the best experience, prefetchAroundLocationWithRadius() should be called as early as possible. + routePrefetcher.prefetchAroundLocationWithRadius(currentLocation: currentGeoCoordinates, radiusInMeters: 2000.0) // Prefetches map data within a corridor along the route that is currently set to the provided Navigator instance. // This happens continuously in discrete intervals. // If no route is set, no data will be prefetched. diff --git a/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift b/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift index 80fa1c1d..d4b742a5 100644 --- a/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift +++ b/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift @@ -73,6 +73,7 @@ class OfflineMapsExample : DownloadRegionsStatusListener { } private func performUpdateChecks() { + logCurrentSDKVersion() logCurrentMapVersion() // Checks if map updates are available for any of the already downloaded maps. @@ -209,6 +210,10 @@ class OfflineMapsExample : DownloadRegionsStatusListener { mapDownloaderTasks.removeAll() } + private func logCurrentSDKVersion() { + print("HERE SDK version: " + SDKBuildInformation.sdkVersion().versionName) + } + private func logCurrentMapVersion() { guard let mapUpdater = mapUpdater else { showMessage("MapUpdater instance not ready. Try again.")