-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Updating lineDashPattern too many times causes error #14491
Comments
Instead of frequently changing the |
Thanks - is there any documentation on how to use an |
We don’t have any examples of using a transition on iOS, as far as I know, but here are the relevant portions of the SDK’s API documentation: For example, you could set this just once when setting up the layer: lineLayer.lineDashPatternTransition = MGLTransition(duration: 1, delay: 0) and your timer could run something like this once a second: lineLayer.lineDashPattern = NSExpression(format: seconds.isMultiple(of: 2) ? "{1, 2}" : "{1, 1}") |
Noting that this was fixed by #15862 |
I'm updating
MGLLineStyleLayer.lineDashPattern
every frame using aCADisplayLink
. This works and looks great, and gives the effect of moving the dashes through the line.However, after about 2 minutes (7k-8k frames), I start to get the following error:
2019-04-23 11:08:29.100222-0700 MapboxSample[543:46382] [WARNING] {}[OpenGL]: line atlas bitmap overflow
Additionally, the line starts flashing every half second or so.
This continues until I remove the layer from the map.
Steps to reproduce
MGLLineStyleLayer
to yourMGLMapView
CADisplayLink
, update the layer'slineDashPattern
.I included a sample View Controller that demonstrates the behavior.
Expected behavior
The line continues to update forever, without any flashes or errors.
Actual behavior
The line starts flashing after 2 minutes along with the above error.
Configuration
Mapbox SDK versions:
4.9.0
iOS/macOS versions:
iOS 12.2
Device/simulator models:
iPhone XS Max
Xcode version:
Xcode 10.2.1
ViewController.swift.zip
The text was updated successfully, but these errors were encountered: