- package com.esri.arcgis.android.samples.helloworld;
- import android.app.Activity;
import android.os.Bundle; - import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISTiledMapServiceLayer; - /**
* The HelloWorld app is the most basic Map app
* for the ArcGIS Runtime SDK for Android.
* It shows how to create a {@link #mMapView} object
* and populate it with a {@link #tileLayer} and
* show the layer on the map.
*
* @author EsriAndroidTeam
* @version 2.0
*
*/ - 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");
// Add tiled layer to MapView
mMapView.addLayer(tileLayer);
}
- @Override
protected void onPause() {
super.onPause();
mMapView.pause();
} - @Override
protected void onResume() {
super.onResume();
mMapView.unpause();
}
}
Hello World for GIS
最新推荐文章于 2024-05-11 08:45:29 发布