问题
I am using MapBox and I would like to pass custom information through an AnnotationPoint. I need that information to display a custom view when the annotation callout is tapped.
The only accessible information is title and subtitle, but that information is displayed in the callout view. This information has to be hidden.
How could I achieve this?
回答1:
You want to subclass the annotation class to add your own properties. Then, in the delegate methods, you can check the type of the annotations passed in, cast them as necessary, and then read the property values in order to act accordingly.
来源:https://stackoverflow.com/questions/34425217/ios-mapbox-pass-custom-info-through-annotation