ShapeSubLayer LineString Tooltips not working with TileLayer
I have a TileLayer that uses ShapeSubLayers to render LineString shapes. Tapping a LineString shape needs to display associated data in a tooltip. I have verified my ShapeSource and DataSource are properly setup as I am able to have DataLabels show up so I know my geoJson is valid and that my PrimaryValuePath and ShapeDataFields are lining up correctly, but tapping the lines does absolutely nothing.
Here is example geoJson I am loading
{"type":"FeatureCollection", "features":[{ "type": "Feature", "properties": {"GeographyId":"1234"}, "geometry":{"type": "LineString","coordinates":[[-84.9147049699999,39.16691768],[-84.91468605,39.16691424],[-84.91465454,39.16687911],[-84.91464203,39.16688339],[-84.91478511,39.1671813699999],[-84.91492097,39.16734955]]} }]}
Here are the types of objects in my DataSource (ObservableCollection<ShapeDataModel>):
public class ShapeDataModel
{
public string GeographyId { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string ColorHex { get; set; }
public int LineThickness { get; set; }
public ShapeDataModel(TicketRouteData routeData)
{
GeographyId = routeData.GeographyId.ToString();
Title = routeData.GeographyTitle;
Description = routeData.GeographyDescription;
ColorHex = routeData.GeographyColor;
LineThickness = routeData.GeographyLineWidth;
}
}
Here is my code for creating the sublayers:
if (!string.IsNullOrEmpty(dataGrouping.ShapeGeoJsonCollection))
{
var mapShapeSublayer = new MapShapeSublayer();
byte[] jsonByteData = Encoding.ASCII.GetBytes(dataGrouping.ShapeGeoJsonCollection);
using MemoryStream jsonStream = new MemoryStream(jsonByteData);
MapSource mapSource = MapSource.FromStream(jsonStream);
mapShapeSublayer.ShowShapeTooltip = true;
mapShapeSublayer.ShapesSource = mapSource;
mapShapeSublayer.DataSource = viewModel.ShapeData; //this is an ObservableCollection<ShapeDataModel>
mapShapeSublayer.PrimaryValuePath = GeoJsonShapeConstants.shapeIdField;
mapShapeSublayer.ShapeDataField = GeoJsonShapeConstants.shapeIdField;
mapShapeSublayer.ShapeStrokeThickness = dataGrouping.Thickness;
mapShapeSublayer.ShapeStroke = Color.FromRgba(dataGrouping.ColorHex);
mapShapeSublayer.ShapeHoverStroke = Colors.Yellow;
mapShapeSublayer.ShapeHoverFill = Colors.Yellow;
mapShapeSublayer.SelectedShapeFill = Colors.Yellow;
mapShapeSublayer.SelectedShapeStroke = Colors.White;
mapShapeSublayer.SelectedShapeStrokeThickness = 1;
mapShapeSublayer.EnableSelection = true;
mapShapeSublayer.ShowDataLabels = true;
mapShapeSublayer.DataLabelSettings = new MapDataLabelSettings()
{
DataLabelPath = "Title"
};
mapShapeSublayer.ShapeTooltipSettings = new MapTooltipSettings()
{
Background = Color.FromRgba("#ffffff"),
Duration = TimeSpan.Parse("99:00:00")
};
mapShapeSublayer.ShapeSelected += OnShapeSelected;
mapSublayers.Add(mapShapeSublayer);
}
foreach (var mapLayer in mapShapSublayers) { sfMapTileLayer.Sublayers.Add(mapLayer); }
Here is my map xaml for the TileLayer
<sfMaps:SfMaps
x:Name="SyncFusionMapControl"
Loaded="OnMapLoaded">
<sfMaps:SfMaps.Layer>
<sfMaps:MapTileLayer
x:Name="sfMapTileLayer"
UrlTemplate="{Binding Source={x:Reference SyncFusionMapControlView}, Path=MapTileSource}"
CanCacheTiles="True"
ShowMarkerTooltip="True"
EnableCenterAnimation="False"
EnableZoomingAnimation="False"
MarkerTemplate="{StaticResource Key=RouteDataMarkerTemplate}"
MarkerTooltipTemplate="{StaticResource Key=RouteDataMarkerTooltipTemplate}"
MarkerSelected="OnMarkerSelected"
DistanceType="Mile"
Radius="500">
<sfMaps:MapTileLayer.Center>
<sfMaps:MapLatLng Latitude="38.24634552001953" Longitude="-95.65771484375"/>
</sfMaps:MapTileLayer.Center>
<sfMaps:MapTileLayer.Markers>
<sfMaps:MapMarkerCollection x:Name="sfMapMarkerCollection"/>
</sfMaps:MapTileLayer.Markers>
<sfMaps:MapTileLayer.MarkerTooltipSettings>
<sfMaps:MapTooltipSettings
Background="#ffffff"
Duration="99:00:00"/>
</sfMaps:MapTileLayer.MarkerTooltipSettings>
<sfMaps:MapTileLayer.ZoomPanBehavior>
<sfMaps:MapZoomPanBehavior
MaxZoomLevel="22"
EnableZooming="True"
EnablePanning="True"/>
</sfMaps:MapTileLayer.ZoomPanBehavior>
</sfMaps:MapTileLayer>
</sfMaps:SfMaps.Layer>
</sfMaps:SfMaps>
Hi Jordan,
Currently,
the .NET MAUI Maps control does not support tooltips for shape sublayers used
within a TileLayer.
We
have prioritized this feature and will plan to implement “Tooltip support
for Shape Sublayers used in Maps TileLayer“ feature in any of our upcoming
releases. During the planning stage for each release cycle, we review all open
features and identify implementations based on parameters such as product
vision, technological feasibility, and customer interest. Please upvote this
feature to prioritize it.
We will notify you when this feature is implemented. However, you can communicate with us regarding any open features at any time using our Feature Report page.
Feedback link: https://www.syncfusion.com/feedback/70562/provide-tooltip-support-for-shape-sublayers-used-in-maps-tilelayer
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.
Regards,
Tamilarasan G.
- 1 Reply
- 2 Participants
-
JH Jordan Hershberger
- Oct 8, 2025 07:57 PM UTC
- Oct 9, 2025 02:16 PM UTC