Skip to content

Commit 964e879

Browse files
Merge pull request #300 from heremaps/esd/41720
Update example apps for release 4.17.2.0
2 parents be1b236 + bdcffc6 commit 964e879

File tree

10 files changed

+42
-19
lines changed

10 files changed

+42
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for
2626

2727
> For now, the _Navigate Edition_ is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials.
2828
29-
## List of Available Example Apps (Version 4.17.1.0)
29+
## List of Available Example Apps (Version 4.17.2.0)
3030

3131
- **HelloMap**: Shows the classic 'Hello World'.
3232
- **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only).

examples/latest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This folder contains the HERE SDK examples apps for version: 4.17.1.0
1+
This folder contains the HERE SDK examples apps for version: 4.17.2.0
22

33
- HERE SDK for Android ([Lite Edition](lite/android/), [Explore Edition](explore/android/), [Navigate Edition](navigate/android/))
44
- HERE SDK for iOS ([Lite Edition](lite/ios/), [Explore Edition](explore/ios/), [Navigate Edition](navigate/ios/))

examples/latest/explore/android/CustomRasterLayers/app/src/main/java/com/here/sdk/customrasterlayers/CustomRasterLayersExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
116116
}
117117

118118
private MapLayer createMapLayer(String dataSourceName) {
119-
// The layer should be rendered on top of other layers.
120-
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().build();
119+
// 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.
120+
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
121121
// And it should be visible for all zoom levels.
122122
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);
123123

examples/latest/explore/flutter/custom_raster_layers_app/lib/CustomRasterLayersExample.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* License-Filename: LICENSE
1818
*/
1919

20-
import 'dart:typed_data';
2120
import 'package:flutter/services.dart';
2221
import 'package:here_sdk/core.dart';
2322
import 'package:here_sdk/mapview.dart';
@@ -29,7 +28,7 @@ class CustomRasterLayersExample {
2928
RasterDataSource? _rasterDataSourceStyle;
3029
MapImage? _poiMapImage;
3130

32-
CustomRasterLayersExample(HereMapController this._hereMapController) {
31+
CustomRasterLayersExample(this._hereMapController) {
3332
double distanceToEarthInMeters = 60 * 1000;
3433
MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters);
3534
_hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom);
@@ -89,8 +88,8 @@ class CustomRasterLayersExample {
8988
}
9089

9190
MapLayer _createMapLayer(String dataSourceName) {
92-
// The layer should be rendered on top of other layers.
93-
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().build();
91+
// 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.
92+
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
9493
// And it should be visible for all zoom levels.
9594
MapLayerVisibilityRange range = MapLayerVisibilityRange(0, 22 + 1);
9695

examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class CustomRasterLayersExample {
9393
}
9494

9595
private func createMapLayer(dataSourceName: String) -> MapLayer {
96-
// The layer should be rendered on top of other layers.
97-
let priority = MapLayerPriorityBuilder().renderedLast().build()
96+
// 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.
97+
let priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer(named: "labels").build()
9898
// And it should be visible for all zoom levels.
9999
let range = MapLayerVisibilityRange(minimumZoomLevel: 0, maximumZoomLevel: 22 + 1)
100100

examples/latest/navigate/android/CustomRasterLayers/app/src/main/java/com/here/sdk/customrasterlayers/CustomRasterLayersExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
116116
}
117117

118118
private MapLayer createMapLayer(String dataSourceName) {
119-
// The layer should be rendered on top of other layers.
120-
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().build();
119+
// 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.
120+
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
121121
// And it should be visible for all zoom levels.
122122
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);
123123

examples/latest/navigate/android/Positioning/app/src/main/java/com/here/examples/positioning/PositioningExample.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import com.here.sdk.location.LocationEngine;
3434
import com.here.sdk.location.LocationEngineStatus;
3535
import com.here.sdk.location.LocationFeature;
36+
import com.here.sdk.location.LocationIssueListener;
37+
import com.here.sdk.location.LocationIssueType;
3638
import com.here.sdk.location.LocationStatusListener;
3739
import com.here.sdk.mapview.LocationIndicator;
3840
import com.here.sdk.mapview.MapMeasure;
@@ -75,6 +77,15 @@ public void onFeaturesNotAvailable(@NonNull List<LocationFeature> features) {
7577
}
7678
};
7779

80+
private final LocationIssueListener locationIssueListener = new LocationIssueListener() {
81+
@Override
82+
public void onLocationIssueChanged(@NonNull List<LocationIssueType> issues) {
83+
for (LocationIssueType issue : issues) {
84+
Log.d(TAG, "Location issue: " + issue.name());
85+
}
86+
}
87+
};
88+
7889
public void onMapSceneLoaded(MapView mapView) {
7990
this.mapView = mapView;
8091

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

104115
private void startLocating() {
105116
locationEngine.addLocationStatusListener(locationStatusListener);
117+
locationEngine.addLocationIssueListener(locationIssueListener);
106118
locationEngine.addLocationListener(locationListener);
107119
locationEngine.start(LocationAccuracy.BEST_AVAILABLE);
108120
}
109121

110122
public void stopLocating() {
123+
locationEngine.removeLocationIssueListener(locationIssueListener);
111124
locationEngine.stop();
112125
}
113126

examples/latest/navigate/flutter/custom_raster_layers_app/lib/CustomRasterLayersExample.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* License-Filename: LICENSE
1818
*/
1919

20-
import 'dart:typed_data';
2120
import 'package:flutter/services.dart';
2221
import 'package:here_sdk/core.dart';
2322
import 'package:here_sdk/mapview.dart';
@@ -29,7 +28,7 @@ class CustomRasterLayersExample {
2928
RasterDataSource? _rasterDataSourceStyle;
3029
MapImage? _poiMapImage;
3130

32-
CustomRasterLayersExample(HereMapController this._hereMapController) {
31+
CustomRasterLayersExample(this._hereMapController) {
3332
double distanceToEarthInMeters = 60 * 1000;
3433
MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters);
3534
_hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom);
@@ -89,8 +88,8 @@ class CustomRasterLayersExample {
8988
}
9089

9190
MapLayer _createMapLayer(String dataSourceName) {
92-
// The layer should be rendered on top of other layers.
93-
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().build();
91+
// 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.
92+
MapLayerPriority priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer("labels").build();
9493
// And it should be visible for all zoom levels.
9594
MapLayerVisibilityRange range = MapLayerVisibilityRange(0, 22 + 1);
9695

examples/latest/navigate/flutter/positioning_app/lib/PositioningExample.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import 'main.dart';
3434

3535
class PositioningExample extends State<MyApp>
3636
with WidgetsBindingObserver
37-
implements LocationListener, LocationStatusListener {
37+
implements LocationListener, LocationStatusListener, LocationIssueListener {
3838
static const String _notAvailable = "--";
3939
static const double _spacing = 8;
4040
static const double _padding = 20;
@@ -50,6 +50,7 @@ class PositioningExample extends State<MyApp>
5050
LocationIndicator? _locationIndicator;
5151
Location? _location;
5252
LocationEngineStatus? _status;
53+
List<LocationIssueType> _issues = <LocationIssueType>[];
5354

5455
// When using HERE Positioning in your app, it is required to request and to show the user's consent decision.
5556
// In addition, users must be able to change their consent decision at any time.
@@ -149,6 +150,10 @@ class PositioningExample extends State<MyApp>
149150
'SinceBoot:',
150151
_getTimestampSinceBootString(),
151152
),
153+
_buildLabelValue(
154+
'Issues:',
155+
_issues.map((issue) => issue.toString().split('.').last).join(', '),
156+
),
152157
const SizedBox(height: _padding),
153158
_buildLabelValue(
154159
'Status:',
@@ -285,10 +290,12 @@ class PositioningExample extends State<MyApp>
285290
// Set delegates and start location engine.
286291
_locationEngine!.addLocationListener(this);
287292
_locationEngine!.addLocationStatusListener(this);
293+
_locationEngine!.addLocationIssueListener(this);
288294
_locationEngine!.startWithLocationAccuracy(LocationAccuracy.bestAvailable);
289295
}
290296

291297
void _stopLocating() {
298+
_locationEngine!.removeLocationIssueListener(this);
292299
_locationEngine!.removeLocationStatusListener(this);
293300
_locationEngine!.removeLocationListener(this);
294301
_locationEngine!.stop();
@@ -357,6 +364,11 @@ class PositioningExample extends State<MyApp>
357364
});
358365
}
359366

367+
@override
368+
void onLocationIssueChanged(List<LocationIssueType> issues) {
369+
setState(() => _issues = issues);
370+
}
371+
360372
Widget _buildLabelValue(String text, String value) {
361373
return Row(
362374
children: <Widget>[

examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class CustomRasterLayersExample {
9393
}
9494

9595
private func createMapLayer(dataSourceName: String) -> MapLayer {
96-
// The layer should be rendered on top of other layers.
97-
let priority = MapLayerPriorityBuilder().renderedLast().build()
96+
// 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.
97+
let priority = MapLayerPriorityBuilder().renderedLast().renderedBeforeLayer(named: "labels").build()
9898
// And it should be visible for all zoom levels.
9999
let range = MapLayerVisibilityRange(minimumZoomLevel: 0, maximumZoomLevel: 22 + 1)
100100

0 commit comments

Comments
 (0)