Wait until style has loaded before doing things to it#339
Merged
Conversation
1ec5
suggested changes
Jul 6, 2017
| @objc(navigationMapView:shouldUpdateTo:) | ||
| func navigationMapView(_ mapView: NavigationMapView, shouldUpdateTo location: CLLocation) -> CLLocation? { | ||
|
|
||
| guard hasFinishedLoadingStyle else { return nil } |
Contributor
There was a problem hiding this comment.
If the style hasn’t finished loading, we can’t manipulate the style in order to query it for street names, but we should still run the rest of this method in order to snap the user’s location to the route.
In fact, that’s what the code already does: it checks for a non-nil style before manipulating the style. style would be nil until the style has finished loading.
Contributor
There was a problem hiding this comment.
So you’re actually right about needing to track hasFinishedLoadingStyle separately. style is nil until the style finishes loading, but sources such as Streets may take a little longer to load. But instead of guard, we need to modify the existing giant if statement.
Contributor
Author
|
@1ec5 fixed |
1ec5
approved these changes
Jul 7, 2017
bsudekum
pushed a commit
that referenced
this pull request
Jul 7, 2017
ericrwolfe
pushed a commit
that referenced
this pull request
Jul 21, 2017
* Begin adding telem events * fix * add timezone * Update * Add remaining events * conditional import * Move back to core * make private * Consolidate telemetry state, outline full telemetry spec * Update date format * Store more state; add device * Updated telemetry event handling * Round events * Add dialog view controller * Reset telemetry session if route updated after arrival * Remove logs; trailing closure syntax * Add userId to feedback event * Hide feedback dialog after 0.5s * Moar trailing closure * Add temporary pod dependency on Mapbox-iOS-SDK * Pass nil feedback description for now * Extend locations collected * Fix location serialization * Reduce locations collected * More battery level precision * remove battery enable flag * Add snapshot to reroute event * Add update + cancel feedback functions * Screenshots as jpeg * Wait until style has loaded before doing things to it (#339) * Fix location permissions and adopt iOS 11 description * Fixed bugs in closestCoordinate and addArrow functions. (#284) * Defer simulated location updates until next run loop (#344) * Did arrive once (#347) * add back * Use telem library * add init * add * add release * fix string * updater * fix * update args * add framework * add certs * move certs * struct * more struct * add * add to tests * add to obj-c * remove * update * bump * Add upcoming step information * Remove telem staging token check (handled upstream) * Add previous step information * Only capitalize first character of step maneuver keys * copy framework * trailing * add framework * add access token * fix * make optional * rename * update event lib * name not version * Better types * Update * No telem in sim * add back * Dont pass in access token * fix * Switch to nested step dictionary in feedback events * Add debug metrics user info key * Fix feedback event types * Moved all event dictionary generation to MMEEventsManager * Move feedback event dict update logic * Bump * Pin to MapboxDirections.swift 0.10.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempts to fix the black lines in #338.
I think in some cases,
mapbox-navigation-ios/MapboxNavigation/RouteMapViewController.swift
Lines 345 to 358 in eab11c9
/cc @frederoni @1ec5 @zijiazhai