mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Can not create a custom annotation view

Open AlaeddineOuerteni opened this issue 4 years ago • 5 comments

With the new MapBox version we can not create custom annotation view as before.

AlaeddineOuerteni avatar Nov 28 '21 19:11 AlaeddineOuerteni

@AlaeddineOuerteni can you provide some additional information regarding what you're trying to create? Are you trying to implement a callout with your annotation view or something different?

ZiZasaurus avatar Nov 30 '21 02:11 ZiZasaurus

@ZiZasaurus, I'm not an issue author but I'm trying to migrate from v6 SDK to v10 SDK and I can't find a way to create a default callout for a point annotation. Looks like there's no such thing in the new SDK 🤔. Or am I missing something?

If there's no default callout, what is the way to create a custom one? Is there an example for it? Any help would be appreciated.

qizh avatar Dec 02 '21 11:12 qizh

ViewAnnotations were made available in v10.2.0-beta.1. Please take a look at our viewAnnotations examples [1, 2].

ZiZasaurus avatar Dec 02 '21 20:12 ZiZasaurus

@ZiZasaurus, thank you. I've seen this functionality and it's great for making custom callouts. Though I was looking for something that is similar to your default callouts from v6.

Default callout usage example for SDK v6

So I don't need to manage all those things on my own:

  • Move the camera so the callout fits the screen when appeared on marker tap.
  • Create a callout view that is aware of map edges and will look well despite of annotation marker's screen location.
  • Manage annotation marker taps to make sure just one callout is visible at a time.

Are you going to introduce such a default callout as a part of SDK anytime soon?

qizh avatar Dec 03 '21 03:12 qizh

The examples mentioned by @ZiZasaurus moved here [1, 2]

ionutivan avatar Jun 21 '23 09:06 ionutivan