1

嗨,,,,我刚刚下载了arcgis插件来在安卓手机上显示地图。当我使用示例代码 (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 freed 234K, 8% free 9552K/10375K, paused 14ms+3ms, total 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.onChildView 10-30 17:17:33.502: D/ArcGIS.LifeCycle(10277): surface.addLayer -> 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:未找到 10-30 17:17:33.532:E/ArcGIS(10277):在 com.esri.core .internal.io.handler.ca(未知来源)10-30 17:17:33.532:E/ArcGIS(10277):在 com.esri.core.internal.io.handler.g$1.handleResponse(未知来源)10 -30 17:17:33.532:E/ArcGIS(10277):在 com.esri.core.internal.io.handler.g$1.handleResponse(未知来源)10-30 17:17:33.532:E/ArcGIS(10277 ):在 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:773) 10-30 17:17:33.532:E/ArcGIS(10277):在 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):在 com.esri.core.internal.io。handler.ga(未知来源)10-30 17:17:33.532:E/ArcGIS(10277):在 com.esri.core.internal.io.handler.ga(未知来源)10-30 17:17:33.532: E/ArcGIS(10277):在 com.esri.core.internal.tasks.apa(未知来源)10-30 17:17:33.532:E/ArcGIS(10277):在 com.esri.android.map.ags。 ArcGISTiledMapServiceLayer.initLayer(未知来源)10-30 17:17:33.532:E/ArcGIS(10277):在 com.esri.android.map.ags.ArcGISTiledMapServiceLayer$1.run(未知来源)10-30 17:17:33.532 : E/ArcGIS(10277): 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) 10-30 17:17:33.532: E/ArcGIS(10277): 在 java.util.concurrent。 FutureTask$Sync.innerRun(FutureTask.java:305) 10-30 17:17:33.532: E/ArcGIS(10277): 在 java.util.concurrent.FutureTask.run(FutureTask.java:137) 10-30 17: 17:33.532:E/ArcGIS(10277):在 java.util.concurrent。ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 10-30 17:17:33.532: E/ArcGIS(10277): 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 10-30 17: 17:33.532:E/ArcGIS(10277):在 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): > 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): >> MapView 等待surface.loaded 10 -30 17:17:33.592:D/ArcGIS.Lock(10277):!!MapView 锁定surface.loaded

4

1 回答 1

0

除非您仅使用 Microsoft 软件(ArcGIS 来自 Esri,而不是 Microsoft),否则您需要记住URL 区分大小写

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

不一样

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

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

尝试第二个,您的应用程序应该可以工作。

于 2013-10-30T12:59:26.093 回答