Select to view content in your preferred language

App crashes when incorrect or incomplete Map layer loading from server

864
4
01-03-2012 09:23 PM
KhurramSaleem
Emerging Contributor
Hello, I am having a problem while loading map layer, problem is defined as below:

We had deployed our own local server and exposed different map layers services.
When there is some maintenance or updating is in progress at our local server.
During that time if we run the iPhone application which accesses our local server then application crashes. Where as application should activate the
"-(void) mapView:(AGSMapView *)mapView failedLoadingLayerForLayerView:(UIView<AGSLayerView> *)layerView withError:(NSError *)error"
or
"-(void) mapView:(AGSMapView *)mapView failedLoadingWithError:(NSError *)error"

events.

According to my understanding actually at server maintenance time when iPhone app tries to load the layer, at that time layer is not correct, so ArcGIS library thinks it to be correct and start doing its processing over that layer, so during that process some error occurs and app crashes. Once our servers are fully up and correct the same app runs perfect.

Secondly i think the error delegates which i mentioned above fired only when server is not available at all, or service is not found, or service is inaccessible, or connection lost, or network not available. But in my case everything is available but map layer itself not correct at server side. So it not handled in ArcGIS library and app crashes.

Can you please let me know is this is some known or unknown issue of ArcGIS library or i am missing something. I had seen this problem in old API as well as new 2.1 api as well.
0 Kudos
4 Replies
AnoopMohandas
Emerging Contributor
Hi Khurram,

Did you find a fix for the crash?
I too had faced a similar kind of issue, application crashes when the the received information is erroneous. Else its working fine.

I believe the crash  is happening during the conversion of the JSON string to corresponding objects and the framework is not properly handling these errors.

Please share if you have any information about this?

Regrads,
Anoop
0 Kudos
KhurramSaleem
Emerging Contributor
No dear i didnt found any fix for this issue. It seems the issue is in ArcGIS library itself. Even no Esri support members attending this issue.
Please let me know if you get anything on it or if i will get any update then i will let you know also.

Regards,
Khurram Saleem
0 Kudos
NimeshJarecha
Esri Regular Contributor
Khurram,

You have mentioned in your first post,
Secondly i think the error delegates which i mentioned above fired only when server is not available at all, or service is not found, or service is inaccessible, or connection lost, or network not available. But in my case everything is available but map layer itself not correct at server side.


Could you please elaborate, "everything is available but map layer itself not correct at server side"?

Regards,
Nimesh
0 Kudos
KhurramSaleem
Emerging Contributor
Hi Nimesh,
Thanks for you response.

Okay i try to explain the problem in different cases.
Case1:
In normal condition when our server is up and running and on iPhone device wifi is available and internet is accessible, then application loads maps correctly and shows everything.

Case 2:
Now let suppose device's wifi is not available or we switch it off for testing then if we try to load the maps from device then event "-(void) mapViewAGSMapView *)mapView failedLoadingLayerForLayerViewUIView<AGSLayerView> *)layerView withErrorNSError *)error" calls correctly and we can tell user that wifi is not available.

Case 3:
Now let suppose device's wifi is available but somehow internet access is not available then if we try to load the maps from device then again event "-(void) mapViewAGSMapView *)mapView failedLoadingLayerForLayerViewUIView<AGSLayerView> *)layerView withErrorNSError *)error" calls correctly and we can tell user that internet is not available.

Case 4:
If we turn the server off or make it inaccesible then if we try to load the maps from device then again event "-(void) mapViewAGSMapView *)mapView failedLoadingLayerForLayerViewUIView<AGSLayerView> *)layerView withErrorNSError *)error" calls correctly and we can tell user server is not available.

Case 5: Problem Case:
If during server upgradation/maintenance or caching tiles at the server, In this case wifi is available, internet is working, server is also accessible, but server's map layers itself caching or upgrading so at that instance map layer are present at server but not correct, so at this instance if we try to load the maps from device then event "-(void) mapViewAGSMapView *)mapView failedLoadingLayerForLayerViewUIView<AGSLayerView> *)layerView withErrorNSError *)error" NEVER CALLS and application crashes.

hope this guide to understand the problem. please let me know if you need more detail on it?

Regards,
Khurram Saleem
0 Kudos