Completed
Last Updated: 05 Jan 2022 10:27 by ADMIN
Release R1 2022
Sylvain
Created on: 26 Nov 2021 13:50
Category: Map
Type: Feature Request
1
RadMap: Introduce Pan and Zoom events
When RadMap is panned or zoomed, a respective event should be fired in order to detect the two operations.
1 comment
ADMIN
Dimitar
Posted on: 05 Jan 2022 10:27

Hello,

The existing ViewPortChanged event of the RadMap should notify the user of Pan and Zoom behaviors. There were two issues related to how the event got raised.

1. The ViewportChanged event was called toŠ¾ many times for Pan with duplicate values. Now it will be called only when the PanOffset is changed.
2. The event was not called at all for  the Zoom case with ViewportChangeaction.Zoom. Now when the user zooms this event will be called 3 times: one time for Pan and one time for Zoom and one time for both. The last time the ViewportChangeAction will be All.

this.radMap1.MapElement.ViewportChanged += MapElement_ViewportChanged;
private void MapElement_ViewportChanged(object sender, ViewportChangedEventArgs e)
{
    if(e.Action == ViewportChangeAction.Pan)
    {
        Console.WriteLine("Down " + this.radMap1.MapElement.PanOffset.Width + ", " + this.radMap1.MapElement.PanOffset.Height);
    }
    if (e.Action == ViewportChangeAction.Zoom)
    {
        Console.WriteLine(this.radMap1.MapElement.ZoomLevel);
    }
}

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.