iOS - MapBox pass custom info through annotation

2019-07-14 04:43发布

问题:

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.



标签: ios mapbox-gl