sergeungar

Pb to center the map

Discussion created by sergeungar on Dec 18, 2013
Latest reply on Dec 19, 2013 by sgill-esristaff
Hello

I'm a newbie in ArcGis under Android.

I would like to center the map on a specific point (for instance 33.666354, -117.903557).


My activity is :


public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mMapView = (MapView)findViewById(R.id.map);

        //MapOptions topo = new MapOptions(MapType.TOPO, 23, -110, 9); 
        //mMapView = new MapView(this, topo);
        
        Point esri4326 = new Point(33.666354, -117.903557);
  Point esri102100 = (Point) GeometryEngine.project(
   esri4326,
   SpatialReference.create(4326),
   SpatialReference.create(102100)
  );
  
  mMapView.centerAt(esri102100, false);
        
        
        topo = new MapOptions(MapType.TOPO);
 streets = new MapOptions(MapType.STREETS);
 natGeo = new MapOptions(MapType.NATIONAL_GEOGRAPHIC);
 ocean = new MapOptions(MapType.OCEANS);
  
 mMapView.setEsriLogoVisible(true);

    }




My xml file is :


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    tools:context=".ArcGisHelloWorldActivity"
    >
 <!-- MapView layout and initial extent -->
 <com.esri.android.map.MapView
  android:id="@+id/map"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  mapoptions.MapType="topo"
        >
 </com.esri.android.map.MapView>
</LinearLayout>


So the map is open but with the world :

[ATTACH=CONFIG]29973[/ATTACH]

Thank you for your help

Attachments

Outcomes