Skip to content

Commit

Permalink
Merge pull request #300 from heremaps/esd/41720
Browse files Browse the repository at this point in the history
Update example apps for release 4.17.2.0
  • Loading branch information
maharudraabhishek authored Feb 2, 2024
2 parents be1b236 + bdcffc6 commit 964e879
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 19 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.17.1.0)
## List of Available Example Apps (Version 4.17.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.17.1.0
This folder contains the HERE SDK examples apps for version: 4.17.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 @@ -116,8 +116,8 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
}

private MapLayer createMapLayer(String dataSourceName) {
// The layer should be rendered on top of other layers.
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().build();
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
// And it should be visible for all zoom levels.
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* License-Filename: LICENSE
*/

import 'dart:typed_data';
import 'package:flutter/services.dart';
import 'package:here_sdk/core.dart';
import 'package:here_sdk/mapview.dart';
Expand All @@ -29,7 +28,7 @@ class CustomRasterLayersExample {
RasterDataSource? _rasterDataSourceStyle;
MapImage? _poiMapImage;

CustomRasterLayersExample(HereMapController this._hereMapController) {
CustomRasterLayersExample(this._hereMapController) {
double distanceToEarthInMeters = 60 * 1000;
MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters);
_hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom);
Expand Down Expand Up @@ -89,8 +88,8 @@ class CustomRasterLayersExample {
}

MapLayer _createMapLayer(String dataSourceName) {
// The layer should be rendered on top of other layers.
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().build();
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
// And it should be visible for all zoom levels.
MapLayerVisibilityRange range = MapLayerVisibilityRange(0, 22 + 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class CustomRasterLayersExample {
}

private func createMapLayer(dataSourceName: String) -> MapLayer {
// The layer should be rendered on top of other layers.
let priority = MapLayerPriorityBuilder().renderedLast().build()
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
let priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer(named: "labels").build()
// And it should be visible for all zoom levels.
let range = MapLayerVisibilityRange(minimumZoomLevel: 0, maximumZoomLevel: 22 + 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
}

private MapLayer createMapLayer(String dataSourceName) {
// The layer should be rendered on top of other layers.
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().build();
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
// And it should be visible for all zoom levels.
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import com.here.sdk.location.LocationEngine;
import com.here.sdk.location.LocationEngineStatus;
import com.here.sdk.location.LocationFeature;
import com.here.sdk.location.LocationIssueListener;
import com.here.sdk.location.LocationIssueType;
import com.here.sdk.location.LocationStatusListener;
import com.here.sdk.mapview.LocationIndicator;
import com.here.sdk.mapview.MapMeasure;
Expand Down Expand Up @@ -75,6 +77,15 @@ public void onFeaturesNotAvailable(@NonNull List<LocationFeature> features) {
}
};

private final LocationIssueListener locationIssueListener = new LocationIssueListener() {
@Override
public void onLocationIssueChanged(@NonNull List<LocationIssueType> issues) {
for (LocationIssueType issue : issues) {
Log.d(TAG, "Location issue: " + issue.name());
}
}
};

public void onMapSceneLoaded(MapView mapView) {
this.mapView = mapView;

Expand Down Expand Up @@ -103,11 +114,13 @@ public void onMapSceneLoaded(MapView mapView) {

private void startLocating() {
locationEngine.addLocationStatusListener(locationStatusListener);
locationEngine.addLocationIssueListener(locationIssueListener);
locationEngine.addLocationListener(locationListener);
locationEngine.start(LocationAccuracy.BEST_AVAILABLE);
}

public void stopLocating() {
locationEngine.removeLocationIssueListener(locationIssueListener);
locationEngine.stop();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* License-Filename: LICENSE
*/

import 'dart:typed_data';
import 'package:flutter/services.dart';
import 'package:here_sdk/core.dart';
import 'package:here_sdk/mapview.dart';
Expand All @@ -29,7 +28,7 @@ class CustomRasterLayersExample {
RasterDataSource? _rasterDataSourceStyle;
MapImage? _poiMapImage;

CustomRasterLayersExample(HereMapController this._hereMapController) {
CustomRasterLayersExample(this._hereMapController) {
double distanceToEarthInMeters = 60 * 1000;
MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters);
_hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom);
Expand Down Expand Up @@ -89,8 +88,8 @@ class CustomRasterLayersExample {
}

MapLayer _createMapLayer(String dataSourceName) {
// The layer should be rendered on top of other layers.
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().build();
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
// And it should be visible for all zoom levels.
MapLayerVisibilityRange range = MapLayerVisibilityRange(0, 22 + 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import 'main.dart';

class PositioningExample extends State<MyApp>
with WidgetsBindingObserver
implements LocationListener, LocationStatusListener {
implements LocationListener, LocationStatusListener, LocationIssueListener {
static const String _notAvailable = "--";
static const double _spacing = 8;
static const double _padding = 20;
Expand All @@ -50,6 +50,7 @@ class PositioningExample extends State<MyApp>
LocationIndicator? _locationIndicator;
Location? _location;
LocationEngineStatus? _status;
List<LocationIssueType> _issues = <LocationIssueType>[];

// When using HERE Positioning in your app, it is required to request and to show the user's consent decision.
// In addition, users must be able to change their consent decision at any time.
Expand Down Expand Up @@ -149,6 +150,10 @@ class PositioningExample extends State<MyApp>
'SinceBoot:',
_getTimestampSinceBootString(),
),
_buildLabelValue(
'Issues:',
_issues.map((issue) => issue.toString().split('.').last).join(', '),
),
const SizedBox(height: _padding),
_buildLabelValue(
'Status:',
Expand Down Expand Up @@ -285,10 +290,12 @@ class PositioningExample extends State<MyApp>
// Set delegates and start location engine.
_locationEngine!.addLocationListener(this);
_locationEngine!.addLocationStatusListener(this);
_locationEngine!.addLocationIssueListener(this);
_locationEngine!.startWithLocationAccuracy(LocationAccuracy.bestAvailable);
}

void _stopLocating() {
_locationEngine!.removeLocationIssueListener(this);
_locationEngine!.removeLocationStatusListener(this);
_locationEngine!.removeLocationListener(this);
_locationEngine!.stop();
Expand Down Expand Up @@ -357,6 +364,11 @@ class PositioningExample extends State<MyApp>
});
}

@override
void onLocationIssueChanged(List<LocationIssueType> issues) {
setState(() => _issues = issues);
}

Widget _buildLabelValue(String text, String value) {
return Row(
children: <Widget>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class CustomRasterLayersExample {
}

private func createMapLayer(dataSourceName: String) -> MapLayer {
// The layer should be rendered on top of other layers.
let priority = MapLayerPriorityBuilder().renderedLast().build()
// The layer should be rendered on top of other layers except the labels layer so that we don't overlap raster layer over POI markers.
let priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer(named: "labels").build()
// And it should be visible for all zoom levels.
let range = MapLayerVisibilityRange(minimumZoomLevel: 0, maximumZoomLevel: 22 + 1)

Expand Down

0 comments on commit 964e879

Please sign in to comment.