Custom Callout MVVM pattern

667
3
01-31-2023 01:41 PM
TreyDalziel
New Contributor II

Hello,

I am in the process of researching what ArcGIS runtime SDK for MAUI (version 200.0.0) has to offer, as I will be transitioning from using Mapbox/Xamarin.Forms.

Below is a screenshot of a Callout in Mapbox, that I am trying recreate something similar here:

TreyDalziel_0-1675199757301.png

I have also found a previous post in this community from 2017 that has a response from @dotMorten_esri , discussing similar topics around creating a custom Callout (https://community.esri.com/t5/net-maps-sdk-questions/popups-in-arcgis-runtime-sdk-for-net/m-p/312338...

TreyDalziel_1-1675200235196.png

However, there seems to be no solid example of how to do so (back in 2017, I am hoping there are some updates?)

I am interested in overriding the 'ControlTemplate', so I can present my own custom Callout, similar to what I was able to accomplish using Mapbox (reference above screenshot).

I have looked at the newest ArcGIS.Samples.Maui demo, but can only find samples of using a Callout with simple string parameters in the CalloutDefinition (the 'text' and 'detailText').

Is the type of custom callout from Mapbox possible to create using the MVVM pattern in MAUI?

Tags (3)
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor

Due to a limitation in both Forms and .NET MAUI we don't have support for custom MAUI XAML content in the callout at this point. You can however do it with the native geo views. For example:
(mapView.Handler.PlatformView as Esri.ArcGISRuntime.UI.Controls.MapView).ShowCalloutAt(locations, nativeView);

The native view would be a native Android View on Android or a UIView on iOS for instance.

0 Kudos
TreyDalziel
New Contributor II

Thanks for the quick reply!

Would this also support a native view for Windows? (Android, iOS AND Windows is what I am looking for)

0 Kudos
dotMorten_esri
Esri Notable Contributor

Yup, on Windows you'd use the WinUI UI APIs