Zooming using the mouse wheel doesn't raise OnZoom or OnZoomComplete event
This is my usage.
<SfMaps Height="60vh"> <MapsEvents MouseMove="OnMouseMove" OnZoom="OnZoom" OnZoomComplete="OnZoomComplete"></MapsEvents> <MapsCenterPosition Latitude="50.66213084684495" Longitude="11.22760477495906"> </MapsCenterPosition> <MapsZoomSettings Enable="true" MaxZoom="15" ZoomFactor="@zoomFactor"> <MapsZoomToolbarSettings BackgroundColor="white"> <MapsZoomToolbarButton ToolbarItems="toolbarItems"></MapsZoomToolbarButton> </MapsZoomToolbarSettings> </MapsZoomSettings> <!-- MapsLayers contains one or more map layers to display on the map --> <MapsLayers> <!-- MapsLayer defines a map layer with shape data and configuration --> <MapsLayer UrlTemplate="https://tile.openstreetmap.org/level/tileX/tileY.png" TValue="string"></MapsLayer> </MapsLayers> </SfMaps>
Edit: Using the tools in the toolbar doesn't raise the events either.
Hi Rainer Prem,
We have created and tested a sample based on your shared configuration. In our testing, we were able to confirm that the OnZoom and OnZoomComplete events are triggered properly when performing zoom actions (including toolbar interactions and mouse wheel zoom).
Below is the sample we used for verification:
@using Syncfusion.Blazor.Maps<SfMaps Height="60vh">
<MapsEvents MouseMove="OnMouseMove"
OnZoom="OnZoom"
OnZoomComplete="OnZoomComplete">
</MapsEvents>
<MapsCenterPosition Latitude="50.66213084684495"
Longitude="11.22760477495906">
</MapsCenterPosition>
<MapsZoomSettings Enable="true"
MaxZoom="15"
ZoomFactor="@zoomFactor">
<MapsZoomToolbarSettings BackgroundColor="white">
<MapsZoomToolbarButton ToolbarItems="toolbarItems">
</MapsZoomToolbarButton>
</MapsZoomToolbarSettings>
</MapsZoomSettings>
<MapsLayers>
<MapsLayer UrlTemplate="https://tile.openstreetmap.org/level/tileX/tileY.png"
TValue="string">
</MapsLayer>
</MapsLayers>
</SfMaps>
@code {
private double zoomFactor = 5;
private List<ToolbarItem> toolbarItems = new()
{
ToolbarItem.Zoom,
ToolbarItem.ZoomIn,
ToolbarItem.ZoomOut,
ToolbarItem.Pan,
ToolbarItem.Reset
};
private void OnMouseMove(MouseMoveEventArgs args)
{
Console.WriteLine("Mouse moved");
}
private void OnZoom(MapZoomEventArgs args)
{
Console.WriteLine("OnZoom triggered");
}
private void OnZoomComplete(MapZoomEventArgs args)
{
zoomFactor = args.TileZoomLevel;
Console.WriteLine("OnZoomComplete triggered");
}
}
Regards,
Karthick Panneerselvam.
Attachment: MapSample_cfcb38bd.zip
I'm sorry, I forgot to tell you that my solution is a webassembly. Maybe that's the problem?
I attached the whole solution.
Attachment: Test_66866433.zip
Hi Rainer Prem,
Thank you for sharing your WebAssembly sample.
We have reviewed and tested the attached solution on our end. Based on our verification, we can confirm that the OnZoom and OnZoomComplete events are triggered correctly during zoom actions, including both mouse wheel zoom and toolbar interactions.
This behavior was validated using your provided sample without any modifications. For your reference, we have also attached a video recording demonstrating that both events are triggered as expected.
Recommendation
We kindly suggest the following checks on your side:
- Clear the browser cache.
- Delete the
binandobjfolders. - Restore and reinstall NuGet packages.
These steps help ensure that outdated builds or cached resources are not affecting the behavior.
Please let us know if you have any concerns.
Thank you for your cooperation.
Regards,
Karthick Panneerselvam
Attachment: Screen_Recording_20260701_102731_f458e073.zip
- 3 Replies
- 2 Participants
-
RP Rainer Prem
- Jun 30, 2026 06:06 AM UTC
- Jul 1, 2026 05:28 AM UTC