jaykappy

Feature Layer

Discussion created by jaykappy on Jan 5, 2012
Latest reply on Jan 13, 2012 by saurabh_gupta-esristaff
Just trying to add a featureLayer and having issues...anyone know why

Would be cool to figure out how to add in xml and in the java page

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<!-- 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.ags.ArcGISFeatureLayer
 Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2"  
    mode="snapshot" />

</com.esri.android.map.MapView>

 
</LinearLayout>



Java:
Anyone know how to add a feature layer to the .java page as well.....I can add DynamicMapServiceLAyers like this...but cant fidn out how to do a Feature Layer

public class AndroidTestingActivity extends Activity {
 
 MapView map = null;

 /** Called when the activity is first created. */
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  // Retrieve the map and initial extent from XML layout
  map = (MapView)findViewById(R.id.map);
  // Add dynamic layer to MapView
  map.addLayer(new ArcGISTiledMapServiceLayer("" +
    "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"));
  map.addLayer(new ArcGISDynamicMapServiceLayer("" +
    "http://gis.logis.org/arcgis/rest/services/MG_Test/MapServer/5"));

Outcomes