Repository navigation
Expose styling options for the user location annotation. - #403
Conversation
There was a problem hiding this comment.
MGLUserLocationStyle appears to be specific to MGLFaux3DUserLocationAnnotationView. If the developer provides a custom view in -mapView:viewForAnnotation:, the return value of this method is ignored. Is there a more generic way to make MGLFaux3DUserLocationAnnotationView more stylable? How about a simple delegate method that says the view will get updated based on a new location? Or more generically, a method that says any annotation view will be updated by the map view?
There was a problem hiding this comment.
You are right. This delegate method will be ignored if the users implements a custom location annotation view. We use a single annotation view to render four types of visual representations. Using a styling object was IMO the best tradeoff to handle this. I am not sure we may want to change rendering individually each visual representation for Hydrogen.
Perhaps changing the name to mapViewStyleForDefaultUserLocationAnnotationView: may sound more explicit?
captainbarbosa
left a comment
There was a problem hiding this comment.
Don't forget the changelog 🙃
There was a problem hiding this comment.
How would you envision this working if the developer wanted to dynamically change the default user location annotation color? When we make an ios-sdk-examples entry for this, we should highlight this kind of use case.
There was a problem hiding this comment.
This method should be documented. If we don't want the documentation to appear in the API guides, prepend the documentation entry with :nodoc:.
In the documentation, we should note that setting the map view's tintColor does not have an effect on this default user location annotation color, as it once did.
There was a problem hiding this comment.
This was a work in progress. I added the documentation.
There was a problem hiding this comment.
I would encourage documenting each of these properties so that the developer has a good sense of what parts of the user location annotation are changing - some things like the approximate properties are new and perhaps not widely understood yet.
There was a problem hiding this comment.
I added the documentation.
745d331 to
b87f0a2
Compare
captainbarbosa
left a comment
There was a problem hiding this comment.
Thanks for adding additional documentation, this is very helpful. I have two minor concerns but otherwise this looks good.
There was a problem hiding this comment.
The puck view's fill color.
or, since the possessive form of "view" feels odd here, maybe:
The fill color for the puck view.
| */ | ||
| @property (nonatomic) UIColor *haloFillColor; | ||
| /** | ||
| The approximate's view halo fill color. |
There was a problem hiding this comment.
I think The halo fill color for the approximate view makes more sense (and for the rest of the properties below).
| /** | ||
| The approximate's view halo fill color. | ||
| */ | ||
| @property (nonatomic) UIColor *approximateHaloFillColor; |
There was a problem hiding this comment.
Should we note that any properties for the approximate view will only work in iOS 14+ when the user has enabled approximate location?
* master: Release 6.2.0 beta.1 prep (#417) Update for Xcode 12 release (#415) Switch background snapshot to periodic. (#412) Fix map stuttering by switching render call to use setNeedsDisplay (#411) Add a flag to enforce using catched tiles (#416) Improve header documentation for MGLObservable (#398) Expose styling options for the user location annotation. (#403)
Fixes #385
Styling example:
Halo
Arrow
Puck
Approximate