I get the following exception when I’m scrolling in my map to zoom in and out:
"Refreshing region is not supported and the user should always check the CanRefreshRegion property to ensure the Overlay supports it before calling."
The exception didn’t happen until I upgraded to on 7.0.296.0
StackTrace:
at ThinkGeo.MapSuite.DesktopEdition.Overlay.RefreshCore(GeoCanvas canvas, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Refresh(GeoCanvas canvas, RectangleShape extent)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.bxU=(IEnumerable`1 cBU=, RectangleShape cRU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.bBU=(RectangleShape bRU=, RectangleShape bhU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.zBU=(RectangleShape zRU=, Overlay zhU=, Int32 zxU=, Int32 0BU=, GeographyUnit 0RU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.1RU=(IEnumerable`1 1hU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.vBU=(RectangleShape vRU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.thU=(Int32 txU=, RectangleShape uBU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.rxU=(InteractionArguments sBU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.kBU=(Object kRU=, Pxc= khU=)
at ThinkGeo.MapSuite.DesktopEdition.MouseEventAnalyzer.OnMouseEvent(Pxc= e)
at ThinkGeo.MapSuite.DesktopEdition.MouseEventAnalyzer.TRU=(Double ThU=, Double TxU=, Double UBU=, Double URU=, Int32 UhU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.rBU=(Object rRU=, MouseEventArgs rhU=)
at System.Windows.Forms.Control.OnMouseWheel(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseWheel(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyProgram.Program.Main() in C:***Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
"Refreshing region is not supported" when scrolling
Hi,
Only our LayerOverlay and its sub classes support refresh target extent, so we will show this exception message if your overlay is not LayerOverlay.
So could you paste some code snippet for reproduce that, which should be helpful for us to make sure whether it’s a bug and we can find a solution for that.
Regards,
Don
Ok, I’ve found out it has something to do with using a custom ZoomLevelSet. The following code sample crashes with said exception whenever I keep zooming in or out beyond the given limits. As mentioned, this exception occurs with DLL 7.0.296.0.
Versions 7.0.293.0 and 7.0.0.300 are fine.
private
void
TestForm_Load(
object
sender, EventArgs e) {
winformsMap1.MapUnit = GeographyUnit.Meter;
// set custom zoomlevelset
winformsMap1.ZoomLevelSet =
new
ZoomLevelSet();
winformsMap1.ZoomLevelSet.ZoomLevel01.Scale = 1000;
winformsMap1.ZoomLevelSet.ZoomLevel02.Scale = 2000;
winformsMap1.ZoomLevelSet.ZoomLevel03.Scale = 5000;
winformsMap1.ZoomLevelSet.ZoomLevel04.Scale = 7500;
winformsMap1.ZoomLevelSet.ZoomLevel05.Scale = 10000;
winformsMap1.ZoomLevelSet.ZoomLevel06.Scale = 15000;
winformsMap1.ZoomLevelSet.ZoomLevel07.Scale = 20000;
winformsMap1.ZoomLevelSet.ZoomLevel08.Scale = 25000;
winformsMap1.ZoomLevelSet.ZoomLevel09.Scale = 50000;
winformsMap1.ZoomLevelSet.ZoomLevel10.Scale = 75000;
winformsMap1.ZoomLevelSet.ZoomLevel11.Scale = 100000;
winformsMap1.ZoomLevelSet.ZoomLevel12.Scale = 125000;
winformsMap1.ZoomLevelSet.ZoomLevel13.Scale = 150000;
winformsMap1.ZoomLevelSet.ZoomLevel14.Scale = 175000;
winformsMap1.ZoomLevelSet.ZoomLevel15.Scale = 200000;
winformsMap1.ZoomLevelSet.ZoomLevel16.Scale = 250000;
winformsMap1.ZoomLevelSet.ZoomLevel17.Scale = 300000;
winformsMap1.ZoomLevelSet.ZoomLevel18.Scale = 400000;
winformsMap1.ZoomLevelSet.ZoomLevel19.Scale = 500000;
winformsMap1.ZoomLevelSet.ZoomLevel20.Scale = 1000000;
winformsMap1.MaximumScale = 1000000;
winformsMap1.MinimumScale = 1000;
//create a overlay with a line feature
TrackInteractiveOverlay featureOverlay =
new
TrackInteractiveOverlay();
List<Vertex> LineSegmentPoints =
new
List<Vertex>();
LineSegmentPoints.Add(
new
Vertex(150, 150));
LineSegmentPoints.Add(
new
Vertex(900, 3000));
Feature f =
new
Feature(
new
LineShape(LineSegmentPoints));
featureOverlay.TrackShapeLayer.InternalFeatures.Add(f);
winformsMap1.Overlays.Add(featureOverlay);
winformsMap1.CurrentExtent =
new
RectangleShape(0, 1000, 1000, 0);
winformsMap1.Refresh();
}
Hi,
Thanks to let us know, it’s a bug we haven’t found before.
We have fixed that and you can find the fix in daily build package version higher than 7.0.303.0.
Regards,
Don
Thanks! I’ll check out 7.0.303.0 when it becomes available.
Hi,
Any question please let us know.
Regards,
Don
I tried the above code sample with 7.0.303.0 and found no improvement. I still get the same exception when scrolling and additionally the one feature of the code sample doesn’t show up.
Hi,
Because some reason, it looks the latest change haven’t been integrated into the daily build package.
Could you please download 7.0.305.0 and let me know whether that works for you?
Regards,
Don
I will try it when it becomes available and let you know.
Hi,
Please let us know whether it works for you.
Regards,
Don
It works! Thanks
Or actually, I’m still having some trouble with the zooming functionality, but since it’s a different exception, I’ve posted it as a new question: thinkgeo.com/forums/MapSuite…fault.aspx
Hi,
Thanks for create new post, that’s very helpful for the guys who will search when they met same problem.
Regards,
Don