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 has been archived by the owner on Aug 8, 2023. It is now read-only.
I'd like to implement a fixed scale overlay view (a CAShapeLayer) on top of a MGLMapView. One that tracks the location of the underlying coordinates and positions itself accordingly. Specifically, I want to draw a line at a fixed screen distance away from and alongside a polyline annotation.
The region change delegate methods let me do this, but they don't fire frequently enough, so the layer jitters as the map scrolls. Looking through the code I can see glkView:drawInRect:, which is used to update the user location annotation view.
Have you considered exposing an API to let me implement something similar myself? I'd consider a MGLMapView subclass, but there isn't a convenient hook into that that point in the drawInRect method.
The text was updated successfully, but these errors were encountered:
This would basically need to happen right about here in the process, between drawing the GL frame and updating the Transform, which affects pixel/geo conversions thereafter.
incanus
changed the title
Fixed scale overlay views
allow iOS per-frame callback
Aug 17, 2015
A combination of -mapViewRegionIsChanging: and -mapView:regionDidChangeAnimated: should actually keep your view in sync with the map; if not, that’s a bug. Otherwise, you certainly could subclass MGLMapView and override -glkView:drawInRect:, but make sure to call super’s implementation in that case. (You’ll probably need to declare that your subclass conforms to GLKViewDelegate, since MGLMapView does so privately.)
@tomtaylor, -[MGLMapViewDelegate mapViewDidFinishRenderingFrame:fullyRendered:] should fire frequently enough for your use case, far more reliably than -mapViewRegionIsChanging: and -mapView:regionDidChangeAnimated:. The method isn’t documented because the fullyRendered parameter doesn’t work as expected yet: #1804. As of #4801, we’re using this callback to update MGLAnnotationViews’ positions on screen as the viewport changes.
I'd like to implement a fixed scale overlay view (a
CAShapeLayer
) on top of aMGLMapView
. One that tracks the location of the underlying coordinates and positions itself accordingly. Specifically, I want to draw a line at a fixed screen distance away from and alongside a polyline annotation.The region change delegate methods let me do this, but they don't fire frequently enough, so the layer jitters as the map scrolls. Looking through the code I can see
glkView:drawInRect:
, which is used to update the user location annotation view.Have you considered exposing an API to let me implement something similar myself? I'd consider a
MGLMapView
subclass, but there isn't a convenient hook into that that point in the drawInRect method.The text was updated successfully, but these errors were encountered: