You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
[ios] Custom Location provider and Annotation Images warping/disappearing when changing image too quickly #4185
I am using mapbox 3.1.2 to draw indoor maps and we would like to be able to show the users location. Since that is not available from the phones native location provider we cannot use ".showsUserLocation = true".
Right now we solve this by using an annotation to show the users location, but this creates a few issues especially with trying to show direction the user is facing. When we update the annotation image too often the annotation image will warp, eventually disappear and then start showing [INFO] {Worker}[Sprite]: Can't find sprite named 'com.mapbox.sprites.userLocation'
Are there any plans to implement a way to set a custom location provider and/or a fix for annotation images when changing them?
I am using mapbox 3.1.2 to draw indoor maps and we would like to be able to show the users location. Since that is not available from the phones native location provider we cannot use ".showsUserLocation = true".
I’m afraid I don’t understand – is the issue that CLLocationManager doesn’t work indoors? If so, there may be a cleaner approach to controlling the built-in user location annotation. Extend or subclass MGLMapView to conform to CLLocationManagerDelegate:
Then call -locationManager:didUpdateLocations:animated: and/or -locationManager:didUpdateHeading: on the MGLMapView instance. This approach is similar to how you’d mock user location for automated testing.
When we update the annotation image too often the annotation image will warp, eventually disappear and then start showing [INFO] {Worker}[Sprite]: Can't find sprite named 'com.mapbox.sprites.userLocation'
You’re removing the annotation and adding a new one every time the location changes, correct? As of #3835, which is in v3.3.0-alpha.2, you can simply change the coordinate property of any point annotation in a KVO-compliant way, and the annotation will move accordingly. That’ll probably avoid this issue.
The underlying rendering artifacting is probably the same issue being tracked in #3185. For this use case, you’ll eventually also be able to use a native UIView for the annotation (#4801), avoiding #3185 entirely.
Activity
stm233 commentedon Mar 14, 2016
i have same problem, do you solve it?
LesSvant commentedon Apr 13, 2016
Stm233, sorry no solution yet.
1ec5 commentedon May 13, 2016
I’m afraid I don’t understand – is the issue that CLLocationManager doesn’t work indoors? If so, there may be a cleaner approach to controlling the built-in user location annotation. Extend or subclass MGLMapView to conform to CLLocationManagerDelegate:
Then call
-locationManager:didUpdateLocations:animated:and/or-locationManager:didUpdateHeading:on the MGLMapView instance. This approach is similar to how you’d mock user location for automated testing.You’re removing the annotation and adding a new one every time the location changes, correct? As of #3835, which is in v3.3.0-alpha.2, you can simply change the
coordinateproperty of any point annotation in a KVO-compliant way, and the annotation will move accordingly. That’ll probably avoid this issue.The underlying rendering artifacting is probably the same issue being tracked in #3185. For this use case, you’ll eventually also be able to use a native UIView for the annotation (#4801), avoiding #3185 entirely.