Panned event handler does not fire

Greetings!

I noticed that the "Panned" event handler does not execute at any time during or after the map is panned.

The "Panning" handler does work as expected though.

Is this a bug or is there another way I can have an event called when the map stops being panned?

Thank you!

Jacob

3 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team April 30, 2021 01:55 PM UTC

Hi Jakub,

Query: Panned" event handler does not execute at any time during or after the map is panned

In SfMap, Panned event will be working only for shapefile layer.  So, for the imagery layer, we suggest you to use MouseLeftButtonUp event. In this event we have checked whether the map is panned or not with panning event, as per below code snippet.

[XAML]: 
        <syncfusion:SfMap Panning="map_Panning" ZoomLevel="5"  MouseLeftButtonUp="map_MouseLeftButtonUp" EnableZoom="True" EnablePan="True"> 
            <syncfusion:SfMap.Layers> 
                <syncfusion:ImageryLayer LayerType="OSM" > 
                </syncfusion:ImageryLayer> 
            </syncfusion:SfMap.Layers> 
        </syncfusion:SfMap> 
 

[C#]:
 
    public partial class MainWindow : Window 
    { 
        bool Panned = false; 
       .... 
  
        private void map_Panning(object sender, PanEventArgs args) 
        { 
            Panned = true; 
        } 
        private void map_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) 
        { 
            if(Panned) 
            { 
                ///Add your code here 
                Panned = false; 
            } 
        } 
    } 

Please have a sample from below link

https://www.syncfusion.com/downloads/support/directtrac/general/ze/MapSample763315333

Query: The "Panning" handler does work as expected though.
When you pan the map or change the Center value, the Panning event will be triggered.
Could you please share the details of the problem that you're facing with this panning event?

Regards,
Sridevi S.
 


Marked as answer

JA Jakub April 30, 2021 02:15 PM UTC

Hi Sridevi and Syncfusion,

Thank you for the quick reply, as usual and for clarifying that the Panned event only works with the shapefile layer.

Your workaround solution is actually very similar to what I came up with also and it works very well for my needs.

As for your question:
Query: The "Panning" handler does work as expected though.
When you pan the map or change the Center value, the Panning event will be triggered.
Could you please share the details of the problem that you're facing with this panning event?
I was only saying that the "Panning" event handler works fine and as expected...there is no problem there :-)

Have a nice day,
Jacob



SS Sridevi Sivakumar Syncfusion Team May 3, 2021 06:56 AM UTC

Hi Jakub,

Thanks for your update.

Let us know if you need any further assistance.

Regards,
Sridevi S. 


Loader.
Up arrow icon