What is the best way to create maptips for graphics in a GraphicsOverlay? It was easy to do in the Silverlight API by setting the MapTip property of a graphic. I am using Runtime 100. Thanks!
You would use the IdentifyGraphicOverlaysAsync method on a mouse-click event to find graphics under the cursor. You can then use the ShowCalloutAt... methods to display a sort of tooltip you'd like.
The automatic maptip-on-hover is no longer available out of the box.
Thanks, this is working well. Is there a way to change the default font name and font size for a callout?
Which platform? WPF, UWP, Xamarin.Android, Xamarin.iOS or Xamarin.Forms?
I am using WPF. Sorry, did not make it clear.
That's ok. The answer just differs per platform, since styling is quite platform dependent. The WPF MapView control uses a "Callout" control to render the callout. So you can change the styling completely by using an implicit style.
<esri:MapView>
<esri:MapView.Resources>
<Style TargetType="esri:Callout">
<Setter Property="FontFamily" Value="Courier New" />
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="5" />
</Style>
</esri:MapView.Resources>
</esri:MapView>
Also note that you can use the ShowCalloutAt overload that takes a UIElement. This allows you to just create a UserControl with whatever content you'd like and get it rendered inside the callout border, instead of relying on the default 4 text, description, button, icon parts.
Perfect answer! Thanks.