View Full Version : Map session paused on SKMapSurfaceView pause?

07.04.2015, 13:46

Need to know how map session 10 minutes time is counted, with regard to onPause() method
I'm interested in two scenarios :
1. User puts app in background
2. User selects whatever widget on map activity and he's taken to another activity
In these two cases, if in onPause() method we have mapView.onPause() as recommended, does the map session time counter pause as well, or we'll be charged for the extra time user spends outside map activity?

11.05.2015, 13:06
Hello gabrjela,

Regardless of the methods you are using the map sessions will be counted based on the minutes of map usage (zooming, panning) and calls to our routing servers.

A map session = 10 minutes of unlimited map usage (zooming, panning) and 10 calls to our routing servers.

Once a route has been calculated all the navigation information will be downloaded to the mobile device – during navigation no server access (internet) access will be required. The SDK can even perform rerouting calls with the downloaded information as not only the route corridor is downloaded but also a buffer corridor along the route (i.e. 2 km to the left & right of the route).

So a scenarios like pan the map to find your destination, ask for a route there and start navigation will most probably require just 1 map session even if the navigation itself might require 1 hour.

Note: the SDK caches as much data as possible and reuses this information whenever possible – so the second time you would request a route to the same place, it will look on the device (cache or offline maps) and see if it can create a route with the already existing information, and only afterwards go to the server

12.05.2015, 09:10
Hi Adela,

Very useful information regarding navigation. I have a question about reusing cache - what does it mean "a route to the same place" ? a route to the exact gps coordinates, or somewhere in a predefined small range around those gps coordinates?
E.g. user has previously navigated to this location 44.436782, 26.099020, respective route has been cached, now user wants to navigate to 44.436702, 26.099056 (11m away from 1st location). Will your api make use of the cached route or it will download another route because a different gps location has been targeted?

Your answer however doesn't clarify my question - I need to know whether map use counting continues between onPause() and onResume().

Thank you

12.05.2015, 10:50
It's not about the route per se as it's about the map data.

If the map data of that particular location is available locally, no server calls are made - if it's not, then a routing call is made to the server, the server calculates the route and provides you the map data associated to that route.

Since for each route we get not just that specific route but also a buffer corridor around the route, it could be that the system may already have the map data associated to the location that's 11m from the first location (the buffer is in km so for sure 11m are covered).
For longer routes, the SDK will calculate a route with the local information and also ask the server to see if any other (better) alternatives available (as the server has access to all the tiles, where the local SDK only has access to the cached or on-board data).

"I need to know whether map use counting continues between onPause() and onResume()."
The timer is started whenever a server request is made (10m, real time) - the next time you make a request to the server, the SDK checks to see if it has a valid map sessions, if not another one will be generated.
So the answer is yes, 10 real time minutes, regardless whether the app is in the foreground or not.