ThinkGeo.com    |     Documentation    |     Premium Support

V12.1 - MapView_CurrentExtentChanged

ThinkGeo Team,

I’ve noticed that MapView_CurrentExtentChanged has different values for MapView.CurrentExtent and EventArgs.NewExtent.

In V10.6 these extent values were the same. I’m thinking that they should be the same in V12.1, which is the value of the new/changed extent.

Your thoughts?

Regards,
Dennis

Thanks Dennis,
In the mapsuite 12 we use a lot of multiple threading things. The Map_CurrentExtentChanged will be triggered once the extentchanged. But the map may not real setup the new extent. So the map.CurrentExtent in Map_CurrentExtentChanged method could be the old one. to verify this you could use this code.

 private void Map_CurrentExtentChanged(object sender, CurrentExtentChangedMapViewEventArgs e)
        {
            System.Diagnostics.Trace.WriteLine("C:" + map.CurrentExtent.ToString());
            System.Diagnostics.Trace.WriteLine("O:" + e.OldExtent.ToString());
            System.Diagnostics.Trace.WriteLine("N:" + e.NewExtent.ToString());
            System.Diagnostics.Trace.WriteLine("----------------------------------------------------");
        }

   private void Button_Click(object sender, RoutedEventArgs e)
        {
            System.Diagnostics.Trace.WriteLine("C:" + map.CurrentExtent.ToString());
            System.Diagnostics.Trace.WriteLine("----------------------------------------------------");
        }

You will find the currentextent could the same as the oldExtent. So we recommend use e.NewExtent if you want to use the new extent immediately.

Thanks

Frank

Frank,

I had already proved to myself that MapView.CurrentExtent is equal to e.OldExtent. That is the problem. In V10.6 CurrentExtent is not equal e.OldExtent.

The purpose of CurrentExtentChanged is that the extent has completely changed and seems you are now changing the definition. If so, then there should be a new event called CurrentExtentChangedComplete or something to that effect.

In my opinion these events should operate exactly as they did in V10.6.

Dennis

Thanks Dennis,
Yes. We have fixed this one. CurrentExtent get change right before the CurrentExtentChanged trigger. You can try with latest V12 nugget package.

Thanks

Frank

hi Frank,

I’ve upgraded to ThinkGeo.Core V13.0.0-beta164 and ThinkGeo.UI.Wpf V13.0.0-beta183.

This issue has been resolved, it is now working as it was under V10.6.

Thanks very much!

Dennis

Thanks Dennis,
Good to know it works. Go ahead let us know if you have any questions.

Thanks

Frank