Skip to content

Commit b90af56

Browse files
Merge pull request #390 from heremaps/esd/42310
Update example apps for release 4.23.1.0
2 parents 8eecb42 + 1880326 commit b90af56

File tree

3,896 files changed

+1091
-561637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,896 files changed

+1091
-561637
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.23.0.0)
29+
## List of Available Example Apps (Version 4.23.1.0)
3030

3131
- **HelloMap**: Shows the classic 'Hello World'.
3232
- **HelloMapWithStoryboard**: Shows the classic 'Hello World' using a Storyboard (iOS 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.23.0.0
1+
This folder contains the HERE SDK examples apps for version: 4.23.1.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/MapItems/app/src/main/java/com/here/mapitems/MainActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import android.view.Menu;
2727
import android.view.MenuInflater;
2828
import android.view.MenuItem;
29+
import android.widget.Toast;
2930

3031
import androidx.annotation.NonNull;
3132
import androidx.annotation.Nullable;
@@ -184,6 +185,10 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
184185
case R.id.polyline_menu_item:
185186
mapObjectsExample.showMapPolyline();
186187
return true;
188+
case R.id.polyline_enable_visibility:
189+
Toast.makeText(this, "Enabled visibility ranges for MapPolyLine", Toast.LENGTH_SHORT).show();
190+
mapObjectsExample.enableVisibilityRangesForPolyline();
191+
return true;
187192
case R.id.clear_map_objects_menu_item:
188193
mapObjectsExample.clearMapButtonClicked();
189194
return true;

examples/latest/explore/android/MapItems/app/src/main/java/com/here/mapitems/MapObjectsExample.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package com.here.mapitems;
2121

2222
import android.util.Log;
23+
import android.widget.Toast;
2324

2425
import com.here.sdk.core.Color;
2526
import com.here.sdk.core.GeoCircle;
@@ -35,6 +36,7 @@
3536
import com.here.sdk.mapview.MapCameraAnimationFactory;
3637
import com.here.sdk.mapview.MapMeasure;
3738
import com.here.sdk.mapview.MapMeasureDependentRenderSize;
39+
import com.here.sdk.mapview.MapMeasureRange;
3840
import com.here.sdk.mapview.MapPolygon;
3941
import com.here.sdk.mapview.MapPolyline;
4042
import com.here.sdk.mapview.MapScene;
@@ -69,6 +71,21 @@ public void showMapPolyline() {
6971
mapScene.addMapPolyline(mapPolyline);
7072
}
7173

74+
public void enableVisibilityRangesForPolyline(){
75+
ArrayList<MapMeasureRange> visibilityRanges = new ArrayList<>();
76+
77+
// At present, only MapMeasure.Kind.ZOOM_LEVEL is supported for visibility ranges.
78+
// Other kinds will be ignored.
79+
visibilityRanges.add(new MapMeasureRange(MapMeasure.Kind.ZOOM_LEVEL,1,10));
80+
visibilityRanges.add(new MapMeasureRange(MapMeasure.Kind.ZOOM_LEVEL,11,22));
81+
82+
// Sets the visibility ranges for this map polyline based on zoom levels.
83+
// Each range is half-open: [minimumZoomLevel, maximumZoomLevel],
84+
// meaning the polyline is visible at minimumZoomLevel but not at maximumZoomLevel.
85+
// The polyline is rendered only when the map zoom level falls within any of the defined ranges.
86+
mapPolyline.setVisibilityRanges(visibilityRanges);
87+
}
88+
7289
public void showMapArrow() {
7390
clearMap();
7491
// Move map to expected location.

examples/latest/explore/android/MapItems/app/src/main/res/menu/map_option_menu.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
android:title="Polygon"/>
1515
<item android:id="@+id/circle_menu_item"
1616
android:title="Circle"/>
17+
<item android:id="@+id/polyline_enable_visibility"
18+
android:title="Enable visibility ranges"/>
1719
<item android:id="@+id/clear_map_objects_menu_item"
1820
android:title="Clear Items"/>
1921
</menu>

examples/latest/explore/android/Routing/app/src/main/java/com/here/routing/RoutingExample.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ private CarOptions getCarOptions() {
386386
// This is needed when e.g. requesting TrafficOnRoute data.
387387
carOptions.routeOptions.enableRouteHandle = true;
388388

389+
// Enable usage of HOV and HOT lanes.
390+
// Note: These lanes will only be used if they are available in the selected country.
391+
carOptions.allowOptions.allowHov = true;
392+
carOptions.allowOptions.allowHot = true;
393+
394+
// When occupantsNumber is greater than 1, it enables the vehicle to use HOV/HOT lanes.
395+
carOptions.occupantsNumber = 4;
396+
389397
// Disabled - Traffic optimization is completely disabled, including long-term road closures. It helps in producing stable routes.
390398
// Time dependent - Traffic optimization is enabled, the shape of the route will be adjusted according to the traffic situation which depends on departure time and arrival time.
391399
carOptions.routeOptions.trafficOptimizationMode = trafficDisabled ?

examples/latest/explore/android/RoutingKotlin/app/src/main/java/com/here/routingkotlin/RoutingExample.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,15 @@ class RoutingExample(private val context: Context, private val mapView: MapView)
312312
get() {
313313
val carOptions = CarOptions()
314314
carOptions.routeOptions.enableTolls = true
315+
316+
// Enable usage of HOV and HOT lanes.
317+
// Note: These lanes will only be used if they are available in the selected country.
318+
carOptions.allowOptions.allowHov = true;
319+
carOptions.allowOptions.allowHot = true;
320+
321+
// When occupantsNumber is greater than 1, it enables the vehicle to use HOV/HOT lanes.
322+
carOptions.occupantsNumber = 4
323+
315324
// Disabled - Traffic optimization is completely disabled, including long-term road closures. It helps in producing stable routes.
316325
// Time dependent - Traffic optimization is enabled, the shape of the route will be adjusted according to the traffic situation which depends on departure time and arrival time.
317326
carOptions.routeOptions.trafficOptimizationMode =

examples/latest/explore/android/Traffic/app/src/main/java/com/here/traffic/TrafficExample.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import com.here.sdk.traffic.TrafficIncidentLookupOptions;
5454
import com.here.sdk.traffic.TrafficIncidentsQueryCallback;
5555
import com.here.sdk.traffic.TrafficIncidentsQueryOptions;
56+
import com.here.sdk.traffic.TrafficLocation;
5657
import com.here.sdk.traffic.TrafficQueryError;
5758
import com.here.time.Duration;
5859

@@ -204,7 +205,14 @@ public void onTrafficIncidentFetched(@Nullable TrafficQueryError trafficQueryErr
204205
if (trafficQueryError == null) {
205206
Log.d(TAG, "Fetched TrafficIncident from lookup request." +
206207
" Description: " + trafficIncident.getDescription().text);
207-
addTrafficIncidentsMapPolyline(trafficIncident.getLocation().polyline);
208+
209+
TrafficLocation incidentLocation = trafficIncident.getLocation();
210+
addTrafficIncidentsMapPolyline(incidentLocation.polyline);
211+
212+
// If the polyline contains any gaps, they are available as additionalPolylines in TrafficLocation.
213+
for (GeoPolyline additionalPolyLine : incidentLocation.additionalPolylines) {
214+
addTrafficIncidentsMapPolyline(additionalPolyLine);
215+
}
208216
} else {
209217
showDialog("TrafficLookupError:", trafficQueryError.toString());
210218
}
@@ -273,13 +281,22 @@ private TrafficIncident getNearestTrafficIncident(GeoCoordinates currentGeoCoord
273281
double nearestDistance = Double.MAX_VALUE;
274282
TrafficIncident nearestTrafficIncident = null;
275283
for (TrafficIncident trafficIncident : trafficIncidentsList) {
276-
// In case lengthInMeters == 0 then the polyline consistes of two equal coordinates.
284+
List<GeoPolyline> trafficIncidentPolyLines = new ArrayList<>();
285+
286+
// In case lengthInMeters == 0 then the polyline consists of two equal coordinates.
277287
// It is guaranteed that each incident has a valid polyline.
278-
for (GeoCoordinates geoCoords : trafficIncident.getLocation().polyline.vertices) {
279-
double currentDistance = currentGeoCoords.distanceTo(geoCoords);
280-
if (currentDistance < nearestDistance) {
281-
nearestDistance = currentDistance;
282-
nearestTrafficIncident = trafficIncident;
288+
trafficIncidentPolyLines.add(trafficIncident.getLocation().polyline);
289+
290+
// If the polyline contains any gaps, they are available as additionalPolylines in TrafficLocation.
291+
trafficIncidentPolyLines.addAll(trafficIncident.getLocation().additionalPolylines);
292+
293+
for (GeoPolyline trafficIncidentPolyline : trafficIncidentPolyLines) {
294+
for (GeoCoordinates geoCoords : trafficIncidentPolyline.vertices) {
295+
double currentDistance = currentGeoCoords.distanceTo(geoCoords);
296+
if (currentDistance < nearestDistance) {
297+
nearestDistance = currentDistance;
298+
nearestTrafficIncident = trafficIncident;
299+
}
283300
}
284301
}
285302
}

examples/latest/explore/flutter/camera_app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.buildlog/
99
.history
1010
.svn/
11+
.cxx/
1112

1213
# IntelliJ related
1314
*.iml

examples/latest/explore/flutter/camera_app/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
344344
GCC_WARN_UNUSED_FUNCTION = YES;
345345
GCC_WARN_UNUSED_VARIABLE = YES;
346-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
346+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
347347
MTL_ENABLE_DEBUG_INFO = NO;
348348
SDKROOT = iphoneos;
349349
SUPPORTED_PLATFORMS = iphoneos;
@@ -366,7 +366,7 @@
366366
"$(PROJECT_DIR)/Flutter",
367367
);
368368
INFOPLIST_FILE = Runner/Info.plist;
369-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
369+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
370370
LD_RUNPATH_SEARCH_PATHS = (
371371
"$(inherited)",
372372
"@executable_path/Frameworks",
@@ -430,7 +430,7 @@
430430
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
431431
GCC_WARN_UNUSED_FUNCTION = YES;
432432
GCC_WARN_UNUSED_VARIABLE = YES;
433-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
433+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
434434
MTL_ENABLE_DEBUG_INFO = YES;
435435
ONLY_ACTIVE_ARCH = YES;
436436
SDKROOT = iphoneos;
@@ -479,7 +479,7 @@
479479
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
480480
GCC_WARN_UNUSED_FUNCTION = YES;
481481
GCC_WARN_UNUSED_VARIABLE = YES;
482-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
482+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
483483
MTL_ENABLE_DEBUG_INFO = NO;
484484
SDKROOT = iphoneos;
485485
SUPPORTED_PLATFORMS = iphoneos;
@@ -504,7 +504,7 @@
504504
"$(PROJECT_DIR)/Flutter",
505505
);
506506
INFOPLIST_FILE = Runner/Info.plist;
507-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
507+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
508508
LD_RUNPATH_SEARCH_PATHS = (
509509
"$(inherited)",
510510
"@executable_path/Frameworks",
@@ -536,7 +536,7 @@
536536
"$(PROJECT_DIR)/Flutter",
537537
);
538538
INFOPLIST_FILE = Runner/Info.plist;
539-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
539+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
540540
LD_RUNPATH_SEARCH_PATHS = (
541541
"$(inherited)",
542542
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)