Select to view content in your preferred language

The ArcGISTiledMapServiceLayer cannot be initialized

1848
2
12-28-2016 06:55 AM
SebastianSchöngenesri
Deactivated User

Hello, in our app, we're using

'com.esri.arcgis.android:arcgis-android:10.2.8-1'.
All of our maps are created via xml:
<com.esri.android.map.MapView
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    mapoptions.ZoomLevel="13"
    mapoptions.center="51.033387, 10.322343" />
and then we create an ArcGISTiledMapServiceLayer
mMap.addLayer(new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"));

This sometimes leads to a black map, which cannot be used.
Completely killing the app mostly helps.

The error we get is as follows:
EsriStatusException 
 

However i have no clue, WHY the layer cannot be initialized.
Also I would be interested in how to properly deal with this Error, since we logged
several thousand of this Error by now across various users and devices.

The screenshots whows an example. Sometimes the FloatingActionButton, which is anchored to the map, is in the upper left corner, as if the map had no size at all

Best Regards, bastischo

0 Kudos
2 Replies
EricBader
Honored Contributor

Right. Yes, with 10.2.8-1 there isn't an easy answer. What you could do is check the validity of the URL and then decide what other known service to add instead.

At version 100, this becomes a bit easier to handle, as you can loadAsync the service layer, verify that it loads successfully in the doneLoading listener, then from there, decide if it should be added to the map or not.

Does this help at all?

0 Kudos
SebastianSchöngenesri
Deactivated User

It helps with understanding when and why this happens.

But ideally a workaround or fix would be the best solution.

Thank you very much.

0 Kudos