无法从HelloWorld示例ArcGIS android SDK中查看地图

时间:2016-04-13 09:43:12

标签: java android xml arcgis

我尝试了ArcGIS android SDK中的Hello World代码,并按照所有步骤操作,但地图没有显示,而是我得到了黑色的mapview。

这是java代码:

package com.example.user.arcgismap;

import android.app.Activity;
import android.os.Bundle;
import com.esri.android.map.MapView;

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.content_main);

    // After the content of this Activity is set, the map can be accessed programmatically from the layout.
    mMapView = (MapView) findViewById(R.id.map);
}

@Override
protected void onPause() {
    super.onPause();

    // Call MapView.pause to suspend map rendering while the activity is paused, which can save battery usage.
    if (mMapView != null)
    {
        mMapView.pause();
    }
}

@Override
protected void onResume() {
    super.onResume();

    // Call MapView.unpause to resume map rendering when the activity returns to the foreground.
    if (mMapView != null)
    {
        mMapView.unpause();
    }
}
} 

这是xml布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.user.arcgismap.MainActivity"
tools:showIn="@layout/activity_main">

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

任何人都可以帮忙,我做错了什么?

1 个答案:

答案 0 :(得分:0)

显然代码运行良好我所要做的就是重新安装apk并等待一点点地图加载。我觉得耐心是一种美德。