Arcgis Esri没有在Android设备上的地图上显示

时间:2013-10-30 09:08:40

标签: java android arcgis esri

枝,,,, 我刚刚下载了arcgis插件来显示andriod手机上的地图。当我使用示例代码(HelloWorld)创建地图时,我将URL更改为[http://e1.onemap.sg/arcgis/rest/services/SN128/mapserver],当我运行程序时,我看到的只是空白,我等了将近10-30分钟,但手机上没有显示任何内容。 如果有人能真正告诉我哪里出错了,我将不胜感激。

这是我的Xml代码

<!-- MapView layout and initial extent -->
<com.esri.android.map.MapView
    android:id="@+id/map"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005">
</com.esri.android.map.MapView>

</LinearLayout>

我的HelloWorld Java类

public class HelloWorld extends Activity {
MapView mMapView = null;
ArcGISTiledMapServiceLayer tileLayer;

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

    // Retrieve the map and initial extent from XML layout
    mMapView = (MapView)findViewById(R.id.map);
    /* create a @ArcGISTiledMapServiceLayer */
    tileLayer = new ArcGISTiledMapServiceLayer(
            //"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
            "http://e1.onemap.sg/arcgis/rest/services/SN128/mapserver");
            // Add tiled layer to MapView
    mMapView.addLayer(tileLayer);

}


@Override
protected void onPause() {
    super.onPause();
    mMapView.pause();
}

@Override
protected void onResume() {
    super.onResume(); 
    mMapView.unpause();
}   

这是我的LogCat

此LOGCAT为蓝色

10-30 17:17:33.417:D / dalvikvm(10277):GC_CONCURRENT释放234K,8%免费9552K / 10375K,暂停14ms + 3ms,总计38ms 10-30 17:17:33.497:D / ArcGIS.LifeCycle(10277):MapSurface初始化com.esri.android.map.MapSurface@41996608 10-30 17:17:33.497:D / ArcGIS.LifeCycle(10277):map.onChildViewAdded 10-30 17:17:33.497:D / ArcGIS.LifeCycle(10277):map.onChildViewAdded 10-30 17:17:33.502:D / ArcGIS.LifeCycle(10277):surface.addLayer - &gt; http://e1.onemap.sg/arcgis/rest/services/SM128/mapserver


此LOGCAT为红色

10-30 17:17:33.532:E / ArcGIS(10277):url = http://e1.onemap.sg/arcgis/rest/services/SM128/mapserver 10-30 17:17:33.532:E / ArcGIS(10277):com.esri.core.io.EsriServiceException:Not Found 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.io.handler.c.a(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.io.handler.g $ 1.handleResponse(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.io.handler.g $ 1.handleResponse(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:773) 10-30 17:17:33.532:E / ArcGIS(10277):at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:743) 10-30 17:17:33.532:E / ArcGIS(10277):at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.io.handler.g.a(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.io.handler.g.a(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.core.internal.tasks.a.p.a(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.initLayer(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at com.esri.android.map.ags.ArcGISTiledMapServiceLayer $ 1.run(Unknown Source) 10-30 17:17:33.532:E / ArcGIS(10277):at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:442) 10-30 17:17:33.532:E / ArcGIS(10277):at java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:305) 10-30 17:17:33.532:E / ArcGIS(10277):at java.util.concurrent.FutureTask.run(FutureTask.java:137) 10-30 17:17:33.532:E / ArcGIS(10277):at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 10-30 17:17:33.532:E / ArcGIS(10277):at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:569) 10-30 17:17:33.532:E / ArcGIS(10277):at java.lang.Thread.run(Thread.java:856)


这是蓝色的

10-30 17:17:33.542:D / ArcGIS.LifeCycle(10277):map.onSizechanged 10-30 17:17:33.547:D /(10277):设备驱动程序API匹配 10-30 17:17:33.547:D /(10277):设备驱动程序API版本:10 10-30 17:17:33.547:D /(10277):用户空间API版本:10 10-30 17:17:33.547:D /(10277):mali:REVISION = Linux-r2p4-02rel0 BUILD_DATE = Thu Oct 25 08:43:05 KST 2012 10-30 17:17:33.562:D / ArcGIS.LifeCycle(10277):&gt; MapSurface.Context已创建。 com.esri.android.map.MapSurface@41996608 10-30 17:17:33.562:D / ArcGIS.LifeCycle(10277):MapSurface取消暂停 10-30 17:17:33.587:D / ArcGIS.LifeCycle(10277):MapSurface SurfaceCreated 10-30 17:17:33.587:D / ArcGIS.LifeCycle(10277):MapSurface SurfaceChanged:480,724 10-30 17:17:33.592:D / ArcGIS.Lock(10277):&gt;&gt; MapView等待surface.loaded 10-30 17:17:33.592:D / ArcGIS.Lock(10277):!! MapView锁定surface.loaded

1 个答案:

答案 0 :(得分:0)

除非您只使用Microsoft软件 - 而ArcGIS来自Esri,而不是Microsoft - 您需要记住URLs are case-sensitive

http://e1.onemap.sg/arcgis/rest/services/SM128/mapserver

不同

http://e1.onemap.sg/ArcGIS/rest/services/SM128/MapServer

单击它们以在浏览器中打开,看看会发生什么。

尝试第二个,你的应用应该可行。