vendredi 20 février 2015

ArcGIS WMS in Android. ArrayIndexOutOfBoundsException


I have a simple Android application that used the ArcGIS SDK to render a map, that works fine, but when I try to use a WMSLayer to render over my map, it generates me an ArrayIndexOutOfBoundsException and I don't get why.


My code: MainActivity.java



package wmstest.com.wmstest;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.esri.android.map.MapView;
import com.esri.android.map.ogc.WMSLayer;

public class MainActivity extends Activity {
MapView mMapView;

// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mMapView = (MapView) findViewById(R.id.map);

try {
String wmsURL = "http://ift.tt/184CniB" +
"?SERVICE=WMS" +
"&VERSION=1.3.0" +
"&REQUEST=GetMap" +
"&FORMAT=image%2Fpng" +
"&TRANSPARENT=true" +
"&LAYERS=craiova_site" +
"&TILED=true" +
"&time_=1424422953367" +
"&WIDTH=256" +
"&HEIGHT=256" +
"&CRS=EPSG%3A31700" +
"&STYLES=&BBOX=312735.5839256644%2C403135.7136541791%2C313346.39561301924%2C403746.52534153394";
WMSLayer wmsLayer = new WMSLayer(wmsURL);
mMapView.addLayer(wmsLayer);
}catch(Exception e){
e.printStackTrace();
Log.e("WMSTEST", e + "");
}
}

}


main.xml



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
mapoptions.MapType="Topo"
mapoptions.center="34.056215, -117.195668"
mapoptions.ZoomLevel="16" />

</LinearLayout>


Stacktrace:



6835-6899/wmstest.com.wmstest E/ArcGIS﹕ url =http://ift.tt/1zSzPcS
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at com.esri.core.internal.tasks.e.a.b.<init>(SourceFile:61)
at com.esri.core.internal.tasks.e.a.b.<init>(SourceFile:43)
at com.esri.android.map.ogc.WMSLayer.initLayer(SourceFile:382)
at com.esri.android.map.ogc.WMSLayer$1.run(SourceFile:206)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)




Aucun commentaire:

Enregistrer un commentaire