I tried using the "edit" feature but it freezes up every time.
I'll add that the version is latest 19.2.0.47
Hello,
I'm trying to utilize the TooltipTemplate of MapsMarkerTooltipSettings (link) but I'm struggling to make it work.
For example, I tried putting it in both under the MapsLayer and under the main component directly, but both cases result in errors in the console. I attached my code for reference. Version is latest 19.2.0.47
Could anyone provide an example? I can't find any such MapMarkerTooltip under the demos.
Thank you
Attachment: MapComponent__Copy_a7bcae94.zip
|
<MapsLayers>
<MapsLayer>
<MapsMarkerSettings>
<MapsMarker>
<MarkerTemplate>
// Marker template code
</MarkerTemplate>
<ChildContent>
<MapsMarkerTooltipSettings Visible="true">
<TooltipTemplate>
<h1>Test</h1>
</TooltipTemplate>
</MapsMarkerTooltipSettings>
</ChildContent>
<MapsMarker>
</MapsMarkerSettings>
<MapsLayer>
</MapsLayers> |
Hello Indumathi,
Thank you very much for your detailed reply, I could confirm the tooltip template is working now!
I have one follow up question. I noticed that the tooltip follows the mouse around.
For my application I had in mind a tooltip that would be stationary in order to make it clickable.
For example, I achieved this using chart tooltip:
Or another example of stationary tooltip is from Syncfusion's chart demo:
https://blazor.syncfusion.com/demos/chart/tooltip-template?theme=bootstrap4
Would you happen to have any suggestions on how to make the tooltip stationary?
Thank you!
|
<SfMaps TooltipDisplayMode="TooltipGesture.Click"> //.. </SfMaps> |
Hello Indumathi,
Thank you for your reply! I understand that this is the default behavior of the Maps control.
I'm going to try to achieve my objective using the Maps Annotation instead of Tooltip.
Thanks,
Sorin
|
<SfMaps>
<MapsEvents OnMarkerClick="MarkerClick" OnMarkerMouseLeave="MarkerLeave"> </MapsEvents> <MapsAnnotations> @if (isAnnotation) { <MapsAnnotation X="@x" Y="@y" ZIndex="3"> <ContentTemplate><div>AnnotationValue</div></ContentTemplate> </MapsAnnotation> } </MapsAnnotations>
</SfMpas> @code{ public bool isAnnotation; public double markerWidth = 50; public double markerHeight = 50; void MarkerClick(MarkerMoveEventArgs args) { isAnnotation = true; x = (args.X - markerWidth).ToString(); y = (args.Y - markerHeight).ToString(); this.StateHasChanged(); } void MarkerLeave(MarkerMouseLeaveEventArgs args) { isAnnotation = false; } } |