Dido_kz

Invalid SpatialReference

Discussion created by Dido_kz on Oct 29, 2012
Latest reply on Nov 1, 2012 by andrewb
Hello, I'm just starting to work with android sdk
I do everything by example helloworld
XML
[HTML]<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-25256.2258543979 -17337.2451528132 28560.1317783174 13883.6506223117">
</com.esri.android.map.MapView>[/HTML]
Java
[HTML]public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  map = (MapView)findViewById(R.id.map);
  // Add dynamic layer to MapView
   basemap = new ArcGISTiledMapServiceLayer("http://myserver:8000/ArcGIS/rest/services/MyServices/MapServer");
  map.addLayer(basemap);

}
[/HTML]
Log:
10-29 11:15:50.520: E/ArcGIS(700): url =http://myserver:8000/ArcGIS/rest/services/MyServices/MapServer
10-29 11:15:50.520: E/ArcGIS(700): java.lang.RuntimeException: Invalid SpatialReference.
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.core.geometry.SpatialReference.nativeGetWKID(Native Method)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.core.geometry.SpatialReference.create(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.core.geometry.SpatialReference.fromJson(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.core.internal.c.g.a(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.core.internal.a.a.n.b(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.initLayer(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at com.esri.android.map.ags.ArcGISTiledMapServiceLayer$1.run(Unknown Source)
10-29 11:15:50.520: E/ArcGIS(700):  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
10-29 11:15:50.520: E/ArcGIS(700):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10-29 11:15:50.520: E/ArcGIS(700):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
10-29 11:15:50.520: E/ArcGIS(700):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
10-29 11:15:50.520: E/ArcGIS(700):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10-29 11:15:50.520: E/ArcGIS(700):  at java.lang.Thread.run(Thread.java:856)

My service is cached and running
where and how to to specify parameter SpatialReference
[ATTACH=CONFIG]18795[/ATTACH]

Attachments

Outcomes