ThinkGeo.com    |     Documentation    |     Premium Support

Random Crashes

I hate to post such a vague message, but I have been unable to figure this out. On our development machines in the office, we don't have any of these issues.


We've installed our app on a couple laptops that we've used for demos. One of the laptops will have several gray tiles that will show up on parts of the google map display, but many of the tiles will show. But then when you would do a lot of panning and zooming, the entire app would just crash/disappear. We tried adding an overall try/catch (any exception) to see if we could get any information, but the catch was just never reached. The app would just disappear. At first we thought it was because of a limited internet connection, but then it happened on the same connection we use when developing and also the problems weren't present on another laptop on that same limited connection.


For a while it seemed that we only had the problem on the one laptop. Recently, another laptop (different model) started showing the same sorts of problems. Not with the gray tiles, but with the app just disappearing with a lot of panning and zooming. Again, the catch exception statement was never reached, it just blew up.


We've basically always been using the latest edition and the first time we noticed this was on the 24th or 25th of February. It happened again in preparing for a demo last week.


What else can I say? I haven't done anything to override any of the panning or zooming, I've just been using the built in functionality. I wish it would happen on our development machines. It would hopefully be easier to understand. Of course, having it only doing this when getting ready for demos is especially painful. I'm getting to where I'm nervous to demo the software because it's been unpredictable. 


I assume the gray tiles are directly related to google maps. I've seen that when just using google maps in the browser on my home computer, but it's strange that this only happens on one machine.


Again, I hate to post such a vague message, but we really haven't been able to understand the cause.


Kimberly



Kimberly, 
 Thanks for your post, we will look into this. It helps a lot if you can send us a demo even if it only recreates this issue on certain machine. 
  
 Thanks 
 ThinkGeo Support 


I had an opportunity to recreate this problem the other day. After playing with it, I think I understand it so I recreated that problem with code. (I could still only be recreating part of the problem, of course.)


In any case, I created a very simple application. It's a WinForms App, with only the map on the display.


In the Form_Load method, the code looks like this.




map.MapUnit = GeographyUnit.Meter;
map.ZoomLevelSet = new GoogleMapZoomLevelSet();
map.ZoomToScale(map.ZoomLevelSet.ZoomLevel03.Scale);
map.CurrentExtent = new RectangleShape(-13621541.981581, 6045025.05978627, -13615228.2234745, 6039397.9944043); //city of seattle +

GoogleMapsLayer googleLayer = new GoogleMapsLayer(googleMapsAPIKey, @"C:\GoogleCache");
map.StaticOverlay.Layers.Add("Google", googleLayer);

map.Refresh();


googleMapsAPIKey of course is a reference to my google key.


If I then run the application, and zoom around Seattle some (to build up some cached data), but then lose my internet connection, when running from the IDE, I see a WebException that says that it could not connection to maps.google.com any time I try to pan outside of what has already been cached from google.

 

The remote name could not be resolved: 'maps.google.com' is the exact error.



I have a try catch in my Program.cs file around everything that is trying to catch a general exception. When I run the application outside of the IDE, the app just disappears under these conditions and the catch statement is never reached.



 Many times when we are demoing our software, we are in secure areas where we either can not have an internet connection or we can only have a connection through a cell phone. Would it be possible to have the map just show black where it can't access google data and raise an exception that I can catch in my application to alert the user and prevent the entire app from disappearing? 



Thanks! Kimberly

Thanks for your report, Kimberly 
  
 The reason for this is that when we fetch image from google, we use another threading, and we ignore to catch the exception and re-throw in the MapControl threading. And many reasons will cause the exception, for example the networks shut down as you described etc. 
  
 We realized this is a potential bug in our GoogleMapsOverlay. We will try to fix it in next release. 
  
 Yale. 


I need to know what the status is on this. I think I am working with the latest version (how do I show that again?) and we are still having this issue. Honestly, this has become a HUGE problem for us. What's the status?



Kimberly, 
  
   We will address this over the next few days.  I will get with the team and come up with a resolution and have something out this week.  Reply to this post to keep it alive please. 
  
 David

Thank you David for the quick response. I look forward to hearing from you.

Kimberly, 
  
   I wanted to update you on this.  We are looking to do two things.  The first is to add some logic to the Google and other layers where we actually spawn more than one thread to get the tiles.  We will handle the exceptions so it will not bring everything down.   
  
 While we were on the topic we also wanted to address runtime error in general for drawing layers and overlays after calling the Refresh.  The Refresh method is a black box to you guys and if you have ten overlays and the first throws an exception you will get an exception on the Refresh line but the other overlays will not draw.  At least that is how it stands now.  What we are looking to do and I would like some feedback on this is to have a property on the Layer and Overlay that allows you to supress drawing exceptions and instead we will paint over the area with a trasnparent red or pink color to signify an error.  The actual drawing of the pink or red tile will be a protected virtual method so you can override it and put whatever you want in there.  The point is when we look through overlays or layers and we get an exception while drawing we check the property and if you have it to rasie hte exception then it functions as it does now and if have it the other way it will eat the exception, write it to the Trace subsystem and then go the route of drawing a visible marker to show something happened but the rest of the layers draw. 
  
 Enum 
 DrawingExceptionMode 
                 Default 
                 ThrowException 
                 DrawException 
  
 All of these on Layer and Overlay base classes 
  
 public DrawingExceptionMode DrawingExceptionMode 
  
                  
 protected DrawException(GeoCanvas canvas, Exception exception) 
 { 
                 // Call the core 
 } 
  
 protected virtual DrawExceptionCore(GeoCanvas canvas, , Exception exception) 
 { 
  
                 // Draw semi transparent red or pink on the canvas 
 } 
  
  
 David

David I think this all sounds good. I like the option of drawing a red box or whatever to alert the user, but then giving them the option to refresh or whatever makes sense. It sounds like with the exceptions you are proposing, I’ll be able to handle this. I like that we’ll have a little more visibility into the refresh method, I sort of wonder if stopping to draw the other overlays is related to another issue I’m having.  
  
 Just to clarify: If there is an exception in getting a tile, it will draw a red tile (or some visual marker on the map), but then there will also be an exception we can catch if we want to prompt the user for action or at least alert them to a possible cause for the map looking different? 
  
 Thanks so much for the help on this. :)  
 Kimberly

Kimberly, 
  
   Thanks for the feedback.  When we draw the exception of some sort we will not raise it.  You can however add an exception property or raise your own event etc by overloading the DrawExeptionCode.  Inside of there you could raise an event then call the base.  You would also set a property and then call the base.  After the refresh is finished then you could loop through the overlays and check the exception property.  You would need to add this property yourself as I don’t see allot of value in adding it just for a few cases.  I mean if something in drawing goes wrong in production the best you can hope for is to log it.  We will be writing the exception to the trace so it can be consumed. 
  
 You should see this coming out in a release around the middle of next week. 
  
 David

Kimberly, 
  
   The latest project at code.thinkgeo.com shows how to build a custom scale bar that support any kind of unit that can be converted to meters.  I think you can use it for your nautical miles issues.  We are still working on the distance issue but things are going well. 
  
 code.thinkgeo.com/ 
  
 David

Hi David, I think that this last post is meant for a different thread. Any luck on the new release?  
  
 Thanks! 
 Kim

Kimberly,


I am glad to let you know that te Google Layer unhandled excpetion problem have been fixed in this public release(3.0.453), the way is David describled above with very minor change. 
 
There is a property called DrawingExceptionMode added both in Overlay & Layer, you can have a try to set different value to see its different result, basiclly I think setting to DrawException will sovle your problem.
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale

Kimberly, 
  
   The release is out and it has the haversine stuff in it.  I am confused on what thread is what but anyway I am saying it here. :-) 
  
 David

Thank you David! 
  
 I downloaded the latest this morning and have been playing with it. I’ve witnessed the pink overlay with a projection error, I think. I’m still playing with it at this point, but I might have more questions later. Thanks again  for getting to this quickly.

Kimberly, 
  
 Thanks for your quick response and letting us know your status. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


utyu     

Vivek, 
  
 I am sorry to say that I could not see your post content. Could you paste again? If you want, you could create a new thread instead of using this one, which seems an old one. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale