Skip to content

Commit

Permalink
Merge pull request #281 from heremaps/esd/41620
Browse files Browse the repository at this point in the history
Update example apps for release 4.16.2.0
  • Loading branch information
maharudraabhishek authored Oct 27, 2023
2 parents e641f25 + 3c22b20 commit abff670
Show file tree
Hide file tree
Showing 104 changed files with 1,596 additions and 361 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.0)
## List of Available Example Apps (Version 4.16.2.0)

- **HelloMap**: Shows the classic 'Hello World'.
- **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only).
Expand Down
2 changes: 1 addition & 1 deletion examples/latest/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains the HERE SDK examples apps for version: 4.16.1.0
This folder contains the HERE SDK examples apps for version: 4.16.2.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/))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
import com.here.sdk.core.GeoCoordinates;
import com.here.sdk.core.GeoPolyline;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.RenderSize;
import com.here.sdk.routing.CarOptions;
import com.here.sdk.routing.Route;
import com.here.sdk.routing.RoutingEngine;
Expand Down Expand Up @@ -76,9 +79,18 @@ private void showRouteOnMap(Route route) {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.getGeometry();
float widthInPixels = 20;
MapPolyline routeMapPolyline = new MapPolyline(routeGeoPolyline,
widthInPixels,
Color.valueOf(0, 0.56f, 0.54f, 0.63f)); // RGBA
Color polylineColor = Color.valueOf(0, 0.56f, 0.54f, 0.63f);
MapPolyline routeMapPolyline = null;
try {
routeMapPolyline = new MapPolyline(routeGeoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
polylineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}
mapView.getMapScene().addMapPolyline(routeMapPolyline);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@
import com.here.sdk.core.GeoPolyline;
import com.here.sdk.core.LanguageCode;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapCamera;
import com.here.sdk.mapview.MapImage;
import com.here.sdk.mapview.MapImageFactory;
import com.here.sdk.mapview.MapMarker;
import com.here.sdk.mapview.MapMeasure;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolygon;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.RenderSize;
import com.here.sdk.routing.AvoidanceOptions;
import com.here.sdk.routing.CalculateIsolineCallback;
import com.here.sdk.routing.CalculateRouteCallback;
Expand Down Expand Up @@ -256,9 +259,18 @@ private void showRouteOnMap(Route route) {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.getGeometry();
float widthInPixels = 20;
MapPolyline routeMapPolyline = new MapPolyline(routeGeoPolyline,
widthInPixels,
Color.valueOf(0, 0.56f, 0.54f, 0.63f)); // RGBA
Color polylineColor = Color.valueOf(0, 0.56f, 0.54f, 0.63f);
MapPolyline routeMapPolyline = null; // RGBA
try {
routeMapPolyline = new MapPolyline(routeGeoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
polylineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}

mapView.getMapScene().addMapPolyline(routeMapPolyline);
mapPolylines.add(routeMapPolyline);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,27 @@

package com.here.mapitems;

import android.util.Log;

import com.here.sdk.core.Color;
import com.here.sdk.core.GeoCircle;
import com.here.sdk.core.GeoCoordinates;
import com.here.sdk.core.GeoCoordinatesUpdate;
import com.here.sdk.core.GeoPolygon;
import com.here.sdk.core.GeoPolyline;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapArrow;
import com.here.sdk.mapview.MapCamera;
import com.here.sdk.mapview.MapCameraAnimation;
import com.here.sdk.mapview.MapCameraAnimationFactory;
import com.here.sdk.mapview.MapMeasure;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolygon;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapScene;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.RenderSize;
import com.here.time.Duration;

import java.util.ArrayList;
Expand Down Expand Up @@ -111,8 +116,18 @@ private MapPolyline createPolyline() {
}

float widthInPixels = 20;
Color lineColor = Color.valueOf(0, 0.56f, 0.54f, 0.63f); // RGBA
MapPolyline mapPolyline = new MapPolyline(geoPolyline, widthInPixels, lineColor);
Color lineColor = new Color(0, (float) 0.56, (float) 0.54, (float) 0.63);
MapPolyline mapPolyline = null;
try {
mapPolyline = new MapPolyline(geoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
lineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}

return mapPolyline;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
import com.here.sdk.core.GeoPolyline;
import com.here.sdk.core.Point2D;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapCamera;
import com.here.sdk.mapview.MapImage;
import com.here.sdk.mapview.MapImageFactory;
import com.here.sdk.mapview.MapMarker;
import com.here.sdk.mapview.MapMeasure;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.RenderSize;
import com.here.sdk.routing.CalculateRouteCallback;
import com.here.sdk.routing.Maneuver;
import com.here.sdk.routing.ManeuverAction;
Expand Down Expand Up @@ -145,10 +148,18 @@ private void showRouteOnMap(Route route) {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.getGeometry();
float widthInPixels = 20;
MapPolyline routeMapPolyline = new MapPolyline(routeGeoPolyline,
widthInPixels,
Color.valueOf(0, 0.56f, 0.54f, 0.63f)); // RGBA

Color polylineColor = Color.valueOf(0, 0.56f, 0.54f, 0.63f);
MapPolyline routeMapPolyline = null;
try {
routeMapPolyline = new MapPolyline(routeGeoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
polylineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}
mapView.getMapScene().addMapPolyline(routeMapPolyline);
mapPolylines.add(routeMapPolyline);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
import com.here.sdk.core.GeoPolyline;
import com.here.sdk.core.Point2D;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapCamera;
import com.here.sdk.mapview.MapImage;
import com.here.sdk.mapview.MapImageFactory;
import com.here.sdk.mapview.MapMarker;
import com.here.sdk.mapview.MapMeasure;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.RenderSize;
import com.here.sdk.routing.CalculateRouteCallback;
import com.here.sdk.routing.CarOptions;
import com.here.sdk.routing.Maneuver;
Expand Down Expand Up @@ -206,9 +209,19 @@ private void showRouteOnMap(Route route) {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.getGeometry();
float widthInPixels = 20;
MapPolyline routeMapPolyline = new MapPolyline(routeGeoPolyline,
widthInPixels,
Color.valueOf(0, 0.56f, 0.54f, 0.63f)); // RGBA
Color polylineColor = new Color(0, (float) 0.56, (float) 0.54, (float) 0.63);
MapPolyline routeMapPolyline = null;

try {
routeMapPolyline = new MapPolyline(routeGeoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
polylineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}

mapView.getMapScene().addMapPolyline(routeMapPolyline);
mapPolylines.add(routeMapPolyline);
Expand Down Expand Up @@ -314,7 +327,18 @@ private void showTrafficOnRoute(Route route) {
continue;
}
float widthInPixels = 10;
MapPolyline trafficSpanMapPolyline = new MapPolyline(span.getGeometry(), widthInPixels, lineColor);
MapPolyline trafficSpanMapPolyline = null;
try {
trafficSpanMapPolyline = new MapPolyline(span.getGeometry(), new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
lineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}

mapView.getMapScene().addMapPolyline(trafficSpanMapPolyline);
mapPolylines.add(trafficSpanMapPolyline);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@
import com.here.sdk.core.Rectangle2D;
import com.here.sdk.core.Size2D;
import com.here.sdk.core.errors.InstantiationErrorException;
import com.here.sdk.mapview.LineCap;
import com.here.sdk.mapview.MapCamera;
import com.here.sdk.mapview.MapFeatureModes;
import com.here.sdk.mapview.MapFeatures;
import com.here.sdk.mapview.MapMeasure;
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
import com.here.sdk.mapview.MapPolyline;
import com.here.sdk.mapview.MapView;
import com.here.sdk.mapview.MapViewBase;
import com.here.sdk.mapview.PickMapContentResult;
import com.here.sdk.mapview.RenderSize;
import com.here.sdk.traffic.TrafficEngine;
import com.here.sdk.traffic.TrafficIncident;
import com.here.sdk.traffic.TrafficIncidentLookupCallback;
Expand Down Expand Up @@ -182,9 +185,18 @@ public void onTrafficIncidentFetched(@Nullable TrafficQueryError trafficQueryErr
private void addTrafficIncidentsMapPolyline(GeoPolyline geoPolyline) {
// Show traffic incident as polyline.
float widthInPixels = 20;
MapPolyline routeMapPolyline = new MapPolyline(geoPolyline,
widthInPixels,
Color.valueOf(0, 0, 0, 0.5f)); // RGBA
Color polylineColor = Color.valueOf(0, 0, 0, 0.5f);
MapPolyline routeMapPolyline = null;
try {
routeMapPolyline = new MapPolyline(geoPolyline, new MapPolyline.SolidRepresentation(
new MapMeasureDependentRenderSize(RenderSize.Unit.PIXELS, widthInPixels),
polylineColor,
LineCap.ROUND));
} catch (MapPolyline.Representation.InstantiationException e) {
Log.e("MapPolyline Representation Exception:", e.error.name());
} catch (MapMeasureDependentRenderSize.InstantiationException e) {
Log.e("MapMeasureDependentRenderSize Exception:", e.error.name());
}

mapView.getMapScene().addMapPolyline(routeMapPolyline);
mapPolylines.add(routeMapPolyline);
Expand Down
4 changes: 2 additions & 2 deletions examples/latest/explore/flutter/camera_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
alignment: Alignment.topCenter,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.lightBlueAccent,
onPrimary: Colors.white,
foregroundColor: Colors.white,
backgroundColor: Colors.lightBlueAccent,
),
onPressed: () => callbackFunction(),
child: Text(buttonLabel, style: TextStyle(fontSize: 20)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ class RouteCalculator {
void _showRouteOnMap(routes.Route route) {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.geometry;
double widthInPixels = 20;
MapPolyline routeMapPolyline =
MapPolyline(routeGeoPolyline, widthInPixels, const Color.fromARGB(160, 0, 144, 138)); // RGBA
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ class EVRoutingExample {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.geometry;
double widthInPixels = 20;
MapPolyline routeMapPolyline = MapPolyline(routeGeoPolyline, widthInPixels, Color.fromARGB(160, 0, 144, 138));
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);

Expand Down
4 changes: 2 additions & 2 deletions examples/latest/explore/flutter/ev_routing_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class _EVRoutingAppState extends State<EVRoutingApp> {
alignment: Alignment.topCenter,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.lightBlueAccent,
onPrimary: Colors.white,
foregroundColor: Colors.white,
backgroundColor: Colors.lightBlueAccent,
),
onPressed: () => callbackFunction(),
child: Text(buttonLabel, style: TextStyle(fontSize: 20)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ class MapObjectsExample {

double widthInPixels = 20;
Color lineColor = Color.fromARGB(160, 0, 144, 138);
MapPolyline mapPolyline = MapPolyline(geoPolyline, widthInPixels, lineColor);
MapPolyline mapPolyline = MapPolyline.withRepresentation(
geoPolyline,
MapPolylineSolidRepresentation(
MapMeasureDependentRenderSize.withSingleSize(RenderSizeUnit.pixels, widthInPixels),
lineColor,
LineCap.round));

return mapPolyline;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/latest/explore/flutter/map_items_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ class _MyAppState extends State<MyApp> {
alignment: Alignment.topCenter,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.lightBlueAccent,
onPrimary: Colors.white,
foregroundColor: Colors.white,
backgroundColor: Colors.lightBlueAccent,
),
onPressed: () => callbackFunction(),
child: Text(buttonLabel, style: TextStyle(fontSize: 20)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ class PublicTransportRoutingExample {
// Show route as polyline.
GeoPolyline routeGeoPolyline = route.geometry;
double widthInPixels = 20;
MapPolyline routeMapPolyline = MapPolyline(routeGeoPolyline, widthInPixels, Color.fromARGB(160, 0, 144, 138));
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);
}
Expand Down Expand Up @@ -172,13 +178,13 @@ class PublicTransportRoutingExample {
double tilt = 0;
// We want to show the route fitting in the map view with an additional padding of 50 pixels.
Point2D origin = Point2D(50, 50);
Size2D sizeInPixels = Size2D(_hereMapController.viewportSize.width - 100, _hereMapController.viewportSize.height - 100);
Size2D sizeInPixels =
Size2D(_hereMapController.viewportSize.width - 100, _hereMapController.viewportSize.height - 100);
Rectangle2D mapViewport = Rectangle2D(origin, sizeInPixels);

// Animate to the route within a duration of 3 seconds.
MapCameraUpdate update = MapCameraUpdateFactory.lookAtAreaWithGeoOrientationAndViewRectangle(route!.boundingBox,
GeoOrientationUpdate(bearing, tilt),
mapViewport);
MapCameraUpdate update = MapCameraUpdateFactory.lookAtAreaWithGeoOrientationAndViewRectangle(
route!.boundingBox, GeoOrientationUpdate(bearing, tilt), mapViewport);
MapCameraAnimation animation = MapCameraAnimationFactory.createAnimationFromUpdate(
update, const Duration(milliseconds: 3000), EasingFunction.inCubic);
_hereMapController.camera.startAnimation(animation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class _MyAppState extends State<MyApp> {
alignment: Alignment.topCenter,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.lightBlueAccent,
onPrimary: Colors.white,
foregroundColor: Colors.white,
backgroundColor: Colors.lightBlueAccent,
),
onPressed: () => callbackFunction(),
child: Text(buttonLabel, style: TextStyle(fontSize: 20)),
Expand Down
Loading

0 comments on commit abff670

Please sign in to comment.