-
Notifications
You must be signed in to change notification settings - Fork 321
Add Streets Source v7 and v8 checks for way name layer #1679
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
6d4e019 to
610da25
Compare
Codecov Report
@@ Coverage Diff @@
## master #1679 +/- ##
===========================================
+ Coverage 26.48% 26.69% +0.2%
- Complexity 815 823 +8
===========================================
Files 202 202
Lines 8513 8533 +20
Branches 623 627 +4
===========================================
+ Hits 2255 2278 +23
+ Misses 6046 6042 -4
- Partials 212 213 +1 |
| } | ||
|
|
||
| @Nullable | ||
| private Source findSourceById(List<Source> sources, String streetsUrl) { |
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.
This method name threw me for a momentary loop: it’s actually finding the source by URL (specifically, by a tileset ID wrapped in a URL).
| if (source instanceof VectorSource) { | ||
| VectorSource vectorSource = (VectorSource) source; | ||
| String url = vectorSource.getUrl(); | ||
| if (url != null && url.contains(streetsUrl)) { |
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.
A source URL might look like this and still be Streets source v8 for the purposes of this feature:
- mapbox://mapbox.mapbox-streets-v8
- mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-traffic-v1
- mapbox://mapbox.mapbox-streets-v8?foo=bar
- mapbox://mapbox.mapbox-streets-v8/?foo=bar
On iOS, we create a URL struct, check that the scheme is mapbox, and split the host on commas. Is it reasonably efficient to create a java.net.URL for each source URL? If not, then it’d be reasonable to search for just the tileset ID within the full URL string. That’ll work until we release Mapbox Streets source v70. 😉
| private static final String MAPBOX_STREETS_V7 = "mapbox://mapbox.mapbox-streets-v7"; | ||
| private static final String MAPBOX_STREETS_V7_URL = "mapbox://mapbox.mapbox-streets-v7"; | ||
| private static final String MAPBOX_STREETS_V8_URL = "mapbox://mapbox.mapbox-streets-v8"; | ||
| private static final String STREETS_SOURCE_ID = "streetsSource"; |
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.
Might want to take this opportunity to make the source ID more unique, like com.mapbox.navigation.streets.
3fb3952 to
2857f5a
Compare
|
@1ec5 this is up-to-date and ready for another round when you have a cycle. |
2857f5a to
b210900
Compare
b210900 to
c75389c
Compare
Guardiola31337
left a comment
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.
Looks good to me ✅
Closes #1624
Please see checklist in ticket for details.
cc @akitchen