-
Notifications
You must be signed in to change notification settings - Fork 320
NAVAND-960: allow different PredictiveCacheLocationOptions for different zooms #6868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ChangelogFeatures
Bug fixes and improvements
Known issues
|
libnavigation-base/src/main/java/com/mapbox/navigation/base/options/PredictiveCacheOptions.kt
Show resolved
Hide resolved
...n-base/src/test/java/com/mapbox/navigation/base/options/PredictiveCacheOptionsBuilderTest.kt
Outdated
Show resolved
Hide resolved
internal val mapsPredictiveCacheLocationOptions = | ||
mutableMapOf<Any, Triple<TilesetDescriptor, TileStore, PredictiveCacheLocationOptions>>() | ||
internal val mapsPredictiveCacheLocationOptions = mutableMapOf<Any, | ||
Pair<TileStore, List<Pair<TilesetDescriptor, PredictiveCacheLocationOptions>>>>() | ||
internal val mapsPredictiveCacheLocationOptionsTileVariant = | ||
mutableMapOf<Any, MutableMap<String, Pair<TileStore, PredictiveCacheLocationOptions>>>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking if we need to store TileStore
here at all.
We use it to recreate controllers, but TileStore
should be the same instance across all calls createMapsController
. We can save it as a PredictiveCache::tileStore on initial call and use for recreations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it? As far as I understand, for different MapboxMap
s there can be different TIleStore
s. That's how we obtain TileStore:
val tileStore = map.getResourceOptions().tileStore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tileStore instance should be built on a customer side and the instance should be passed to Maps, NN, Search
, so all SDKs will work with the same offline folder
val tileStore = TileStore.create(context.provideTileStorePath())
according to the docs
Creates a TileStore instance for the given storage path. The returned instance exists as long as it is retained by the client. If the tile store instance already exists for the given path this method will return it without creating a new instance, thus making sure that there is only one tile store instance for a path at a time. If the given path is empty, the tile store at the default location is returned.
that's why I think we shouldn't store it for each MapboxMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But can't the user use different paths for different MapboxMap
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, all I'm saying is that it's possible, so should we artificially remove this possibility? Especially considering the fact that it was possible previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I think we can follow-up separately as this PR did not change this behaviour, right?
Codecov Report
@@ Coverage Diff @@
## main #6868 +/- ##
============================================
- Coverage 72.85% 72.76% -0.10%
+ Complexity 5657 5579 -78
============================================
Files 786 783 -3
Lines 30434 30192 -242
Branches 3607 3570 -37
============================================
- Hits 22172 21968 -204
+ Misses 6831 6798 -33
+ Partials 1431 1426 -5
|
libnavigation-base/src/main/java/com/mapbox/navigation/base/options/PredictiveCacheOptions.kt
Outdated
Show resolved
Hide resolved
libnavigation-base/src/main/java/com/mapbox/navigation/base/options/PredictiveCacheOptions.kt
Outdated
Show resolved
Hide resolved
libnavigation-base/src/main/java/com/mapbox/navigation/base/options/PredictiveCacheOptions.kt
Outdated
Show resolved
Hide resolved
4f70849
to
97b2840
Compare
No description provided.