heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
145 stars 191 forks source link

Offline Maps HERE-SDK - offline search and navigation #482

Open andreas-arkulpa opened 2 years ago

andreas-arkulpa commented 2 years ago

Hi all!

I am using HERE-Android-SDK to build a simple navigation solution with offline maps. While using the offline mode for the search addresses and calculation of a route, I can see that there are results returned from the address-search, which are not included in the installed offline map datasets. Is there anything additional which I need to do, in order to get only search results which are located inside the offline-map data installed on my device?

I am using the following code snippets.

mapsLoader.selectDataGroup(MapPackage.SelectableDataGroup.TruckAttributes)
mapsLoader.installMapPackages(listOf(mapPackageId))
val term = "New York"
val center = GeoCoordinate(lastWayPoint.latitude, lastWayPoint.longitude)
val request = SearchRequest(term)
request.connectivity = Request.Connectivity.OFFLINE
request.locale = Locale.GERMAN
request.setSearchCenter(center)
request.collectionSize = 5
request.execute { data, error -> 
  if (error != ErrorCode.NONE) return
  // handle search results here
}

Thanks for all of your help in advance!