Skip to content

Commit f1f73cf

Browse files
Merge pull request #304 from heremaps/esd/41740
Update example apps for release 4.17.4.0
2 parents 3f7a572 + cf931b1 commit f1f73cf

File tree

23 files changed

+146
-86
lines changed

23 files changed

+146
-86
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.3.0)
29+
## List of Available Example Apps (Version 4.17.4.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.3.0
1+
This folder contains the HERE SDK examples apps for version: 4.17.4.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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public void onMapSceneLoaded(MapView mapView, Context context) {
6969

7070
// Add a POI marker
7171
addPOIMapMarker(new GeoCoordinates(52.530932, 13.384915));
72-
73-
// Users of the Navigate Edition can set the visibility for all the POI categories to hidden.
74-
// List<String> categoryIds = new ArrayList<>();
75-
// MapScene.setPoiVisibility(categoryIds, VisibilityState.HIDDEN);
7672
}
7773

7874
public void enableButtonClicked() {
@@ -116,8 +112,10 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
116112
}
117113

118114
private MapLayer createMapLayer(String dataSourceName) {
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();
115+
// The layer should be rendered on top of other layers except the "labels" layer
116+
// so that we don't overlap the raster layer over POI markers.
117+
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedBeforeLayer("labels").build();
118+
121119
// And it should be visible for all zoom levels.
122120
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);
123121

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class CustomRasterLayersExample {
4242

4343
// Add a POI marker
4444
_addPOIMapMarker(GeoCoordinates(52.530932, 13.384915), 1);
45-
46-
// Users of the Navigate Edition can set the visibility for all the POI categories to hidden.
47-
// List<String> categoryIds = [];
48-
// MapScene.setPoiVisibility(categoryIds, VisibilityState.hidden);
4945
}
5046

5147
void enableButtonClicked() {
@@ -88,8 +84,10 @@ class CustomRasterLayersExample {
8884
}
8985

9086
MapLayer _createMapLayer(String dataSourceName) {
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();
87+
// The layer should be rendered on top of other layers except for the "labels" layer
88+
// so that we don't overlap the raster layer over POI markers.
89+
MapLayerPriority priority = MapLayerPriorityBuilder().renderedBeforeLayer("labels").build();
90+
9391
// And it should be visible for all zoom levels.
9492
MapLayerVisibilityRange range = MapLayerVisibilityRange(0, 22 + 1);
9593

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,9 @@ class CustomRasterLayersExample {
4040

4141
// We want to start with the default map style.
4242
rasterMapLayerStyle.setEnabled(false)
43-
43+
4444
// Add a POI marker
4545
addPOIMapMarker(geoCoordinates: GeoCoordinates(latitude: 52.530932, longitude: 13.384915))
46-
47-
// Users of the Navigate Edition can set the visibility for all the POI categories to hidden.
48-
// let categoryIds: [String] = []
49-
// MapScene.setPoiVisibility(categoryIds: categoryIds, visibility: VisibilityState.hidden)
5046
}
5147

5248
func onEnableButtonClicked() {
@@ -68,17 +64,17 @@ class CustomRasterLayersExample {
6864
// Maps © www.thunderforest.com, Data © www.osm.org/copyright.
6965
// Alternatively, choose another tile provider or use the (customizable) map styles provided by HERE.
7066
let templateUrl = "https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png"
71-
67+
7268
// The storage levels available for this data source. Supported range [0, 31].
7369
let storageLevels: [Int32] = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
7470
var rasterProviderConfig = RasterDataSourceConfiguration.Provider(
7571
urlProvider: TileUrlProviderFactory.fromXyzUrlTemplate(templateUrl)!,
7672
tilingScheme: TilingScheme.quadTreeMercator,
77-
storageLevels: storageLevels)
78-
73+
storageLevels: storageLevels)
74+
7975
// If you want to add transparent layers then set this to true.
8076
rasterProviderConfig.hasAlphaChannel = false
81-
77+
8278
// Raster tiles are stored in a separate cache on the device.
8379
let path = "cache/raster/mycustomlayer"
8480
let maxDiskSizeInBytes: Int64 = 1024 * 1024 * 128 // 128 MB
@@ -91,10 +87,12 @@ class CustomRasterLayersExample {
9187
provider: rasterProviderConfig,
9288
cache: cacheConfig))
9389
}
94-
90+
9591
private func createMapLayer(dataSourceName: String) -> MapLayer {
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()
92+
// The layer should be rendered on top of other layers except for the "labels" layer
93+
// so that we don't overlap the raster layer over POI markers.
94+
let priority = MapLayerPriorityBuilder().renderedBeforeLayer(named: "labels").build()
95+
9896
// And it should be visible for all zoom levels.
9997
let range = MapLayerVisibilityRange(minimumZoomLevel: 0, maximumZoomLevel: 22 + 1)
10098

@@ -115,7 +113,7 @@ class CustomRasterLayersExample {
115113
fatalError("MapLayer creation failed Cause: \(InstantiationException)")
116114
}
117115
}
118-
116+
119117
private func addPOIMapMarker(geoCoordinates: GeoCoordinates) {
120118
guard
121119
let image = UIImage(named: "poi.png"),

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public void onMapSceneLoaded(MapView mapView, Context context) {
6969

7070
// Add a POI marker
7171
addPOIMapMarker(new GeoCoordinates(52.530932, 13.384915));
72-
73-
// Users of the Navigate Edition can set the visibility for all the POI categories to hidden.
74-
// List<String> categoryIds = new ArrayList<>();
75-
// MapScene.setPoiVisibility(categoryIds, VisibilityState.HIDDEN);
7672
}
7773

7874
public void enableButtonClicked() {
@@ -116,8 +112,10 @@ private RasterDataSource createRasterDataSource(String dataSourceName) {
116112
}
117113

118114
private MapLayer createMapLayer(String dataSourceName) {
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();
115+
// The layer should be rendered on top of other layers except the "labels" layer
116+
// so that we don't overlap the raster layer over POI markers.
117+
MapLayerPriority priority = new MapLayerPriorityBuilder().renderedBeforeLayer("labels").build();
118+
121119
// And it should be visible for all zoom levels.
122120
MapLayerVisibilityRange range = new MapLayerVisibilityRange(0, 22 + 1);
123121

examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/DrawingSwitcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ private void setVenue(Venue venue) {
167167
.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
168168
height += childView.getMeasuredHeight();
169169
}
170-
Log.d("DrawingSwitcher", "marginTop:" + margin.topMargin + "height: " + height);
171-
margin.setMargins(margin.leftMargin, 1500 - height, margin.rightMargin, margin.bottomMargin);
170+
Log.d("DrawingSwitcher", "marginTop:" + margin.topMargin + " height: " + height);
171+
margin.setMargins(margin.leftMargin, 1550 - height, margin.rightMargin, margin.bottomMargin);
172172
setCollapsed(true);
173173
setVisible(true);
174174
}

examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/MainActivity.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ private void loadMapScene() {
272272
// Load a scene from the HERE SDK to render the map with a map scheme.
273273
mapView.getMapScene().loadScene(MapScheme.NORMAL_DAY, mapError -> {
274274
if (mapError == null) {
275-
Anchor2D anchor = new Anchor2D(0,0);
276-
Point2D offset = new Point2D(0, 1800);
277-
mapView.setWatermarkLocation(anchor, offset);
275+
setWatermark(1800);
278276
double distanceInMeters = 1000 * 10;
279277
MapMeasure mapMeasureZoom = new MapMeasure(MapMeasure.Kind.DISTANCE, distanceInMeters);
280278
mapView.getCamera().lookAt(
@@ -389,6 +387,7 @@ public void onGetVenueCompleted(int venueId, @Nullable VenueModel venueModel, bo
389387
} else {
390388
mapLoadDone = true;
391389
mapView.getCamera().zoomTo(18);
390+
setWatermark(1600);
392391
geometryList = venueModel.getGeometriesByName();
393392
venueTapController.setGeometries(geometryList);
394393
recyclerView.setAdapter(new SpaceAdapter(getApplicationContext(), geometryList, MainActivity.this));
@@ -415,12 +414,17 @@ public void onGetVenueCompleted(int venueId, @Nullable VenueModel venueModel, bo
415414
mapView.getCamera().lookAt(
416415
new GeoCoordinates(venueCenter.latitude, venueCenter.longitude),
417416
mapMeasureZoom);
417+
setWatermark(1600);
418418

419419
// Venue selection is done, enable back the button for the venue selection
420420
// to be able to select another venue.
421421
progressBar.setVisibility(View.GONE);
422422
mapLoadDone = true;
423423
header.setVisibility(View.VISIBLE);
424+
if(!selectedVenue.getVenueModel().getTopologies().isEmpty())
425+
topologyButton.setVisibility(View.VISIBLE);
426+
else
427+
topologyButton.setVisibility((View.GONE));
424428
}
425429
};
426430

@@ -467,6 +471,13 @@ public void onVenueLoadError(VenueErrorCode venueLoadError) {
467471
alert.show();
468472
}
469473

474+
void setWatermark(int off)
475+
{
476+
Anchor2D anchor = new Anchor2D(0,0);
477+
Point2D offset = new Point2D(0, off);
478+
mapView.setWatermarkLocation(anchor, offset);
479+
}
480+
470481
// Hide a keyboard.
471482
public void hideKeyboard() {
472483
try {
@@ -540,6 +551,7 @@ private void removeVenue() {
540551
venue_search.setHint("Search for Venues");
541552
loadMapScene();
542553
header.setVisibility(View.GONE);
554+
topologyButton.setVisibility(View.GONE);
543555
levelSwitcher.setVisible(false);
544556
drawingSwitcher.setVisible(false);
545557
VenueMap venueMap = venueEngine.getVenueMap();

examples/latest/navigate/android/IndoorMap/app/src/main/res/drawable/drawing_listview_background.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
<solid android:color="#FFFFFF" />
55
<padding
66
android:left="16dp"
7-
android:right="16dp"
8-
android:bottom="16dp"
9-
android:top="16dp"/>
7+
/>
108
<corners
119
android:radius="4dp" />
1210
</shape>

examples/latest/navigate/android/IndoorMap/app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
android:id="@+id/header"
2424
android:gravity="center"
2525
android:background="@android:color/white"
26+
android:orientation="horizontal"
27+
android:weightSum="100"
2628
android:elevation="3dp">
2729
<ImageButton
2830
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)