public class HelloWorld extends Activity { MapView mMapView; LocationDisplayManager ldm; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMapView = new MapView(this); mMapView.addLayer(new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer")); setContentView(mMapView); try { ldm = mMapView.getLocationDisplayManager(); PictureMarkerSymbol check = new PictureMarkerSymbol(this, getResources().getDrawable(R.drawable.checkmark)); PictureMarkerSymbol gps2 = new PictureMarkerSymbol(this, getResources().getDrawable(R.drawable.gps2)); ldm.setLocationAcquiringSymbol(gps2); ldm.setDefaultSymbol(check); ldm.setCourseSymbol(check); ldm.start(); } catch(Exception e) { e.printStackTrace(); } } @Override protected void onPause() { super.onPause(); mMapView.pause(); } @Override protected void onResume() { super.onResume(); mMapView.unpause(); } }
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.