heremaps / here-ios-sdk-examples

Objective-C and Swift projects using the HERE SDK for iOS.
MIT License
60 stars 56 forks source link

How to show downloaded region in NMAMapView? #99

Closed imanuelpardosi closed 5 years ago

imanuelpardosi commented 5 years ago

Hi there! I downloaded and run map-downloader-ios-swift project and it worked well. After finished download 1 region, how do we show that region in mapview without an internet connection? And is it possible to add routes in that downloaded region in offline mode?

f4st commented 5 years ago

Hello @imanuelpardosi

Thank you for asking a question. There are 2 approaches of Map Data download which are used in Premium SDK: 1) Passive approach 2) Active approach

The passive (also known as downloaded on-demand) is executed implicitly for developer. When user scrolls the map to previously not visible region - the mapView downloads the data for representation and caches it. This approach stores minimum data and will not allow to use routing in offline.

The active approach has two alternatives: A) Map Packages B) Bounding Box or Route

The Premium SDK supports offline mode to build a route, but map packages should be previously downloaded. After package was downloaded you can show any its region by setting mapView geoCenter. E.g:

NMAGeoCoordinates *geoCoordCenter = [[NMAGeoCoordinates alloc]
 initWithLatitude:49.260327 longitude:-123.115025];
[self.mapView setGeoCenter:geoCoordCenter withAnimation:NMAMapAnimationNone];

Kind regards, @f4st

imanuelpardosi commented 5 years ago

Hi @f4st, thank you so much for the great explanation! Will try your solution. My question, do you have example project of Bounding Box or Route, cause I didn't see in this repository. Thank you.

f4st commented 5 years ago

Hi @imanuelpardosi,

The NMAMapDataPrefetcher is used for Bounding Box or Route map data download. Currently we don't have a example project, but these methods code examples are described in documentation (section "Map Download by Specifying a Bounding Box or Route"). Note that these options will have limits in size (depending on cache), while NMAMapLoader wouldn't.

Kind regards, @f4st

imanuelpardosi commented 5 years ago

Hi @f4st, thank you, I already read the documentation.

I have another question about Map Packages, after I downloaded one regional, is it possible to use NMANavigationManager in offline mode? I wanna provide voice and visual instructions in offline mode.

Thanks in advance.

f4st commented 5 years ago

Hi @imanuelpardosi,

I have another question about Map Packages, after I downloaded one regional, is it possible to use NMANavigationManager in offline mode? I wanna provide voice and visual instructions in offline mode.

The HERE SDK Premium edition supports offline usage. After map packages for required region are downloaded the route calculation and navigation guidance (voice and visual instructions) will be available in offline mode.

NOTE that feature list depends from your license key. In case the trial period of feature has expired please contact the sales representative.

Kind regards, @f4st

imanuelpardosi commented 5 years ago

Hi @f4st, thank you so much! :)

JayeshMardiya commented 4 years ago

@imanuelpardosi How did you download the map using a bounding box?

dashchak commented 4 years ago

@JayeshMardiya please take a look at NMAMapDataPrefetcher -fetchMapDataForBoundingBox:error:

anjanaagrawal35 commented 3 years ago

Hello Team,

We need to download the map for offline mode. But the condition is only to download the map with zoom level 11. So that it does not consume space in the end user's phone.

dashchak commented 3 years ago

Hello @anjanaagrawal35, HERE SDK uses vector graphics underneath. It means once you download map data for a bounding box, it will be used for all zoom levels of this box

anjanaagrawal35 commented 3 years ago

Thanks, @dashchak for your valuable feedback.

I have one more question, we can download the map using the radius.

anjanaagrawal35 commented 3 years ago

Team, Can you please help us with the above questions?

dashchak commented 3 years ago

So is it the same as the bounding box [in terms of underneath]?

Correct, it is the same

And is there any limitation for the radius[in miles, km, meter]?

We have limitation per downloading area. In case it is too big you will receive NMAPrefetchRequestErrorRouteAreaTooBig error. Current prefetch area limit equals 40000000000 square meters. It is private and can be changed in future though.

And we can limit the size of downloading maps? like:- low level, mid level and high level resolution with size?

It is not supported. Take a look at NMAMapLoader's (void)selectDataGroup:(NMAMapDataGroup)dataGroup which impacts package size

The last thing is there any limitation while defining bounding box?[in size]

Again the limitation is only in areaSize of bounding box. You can use NMAMapLoader which does not have such limits.

anjanaagrawal35 commented 3 years ago

Ok Thank You.

akash0377 commented 3 years ago

Hello any one have example code to download map using bounding box, please share.

dashchak commented 3 years ago

Please find answer in new thread: https://github.com/heremaps/here-ios-sdk-examples/issues/208