Guest User

Untitled

a guest
Oct 16th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. featureServiceTable = new GeodatabaseFeatureServiceTable(FEATURE_SERVICE_URL, 0);
  2.  
  3. // Test log here
  4. Log.e(TAG, featureServiceTable.toString());
  5.  
  6. 10-16 14:31:07.814 27896-27896/com.dev.mthaqifisa.remakejkptg E/MainActivity: GeodatabaseFeatureTable [Name=null, ID=-1, geodatabase=null]
  7.  
  8. MapView mMapView = null;
  9. public GeodatabaseFeatureServiceTable featureServiceTable;
  10. final String FEATURE_SERVICE_URL = "http://www.....my/arcgis/rest/services/.../charting/MapServer";
  11.  
  12. @Override
  13. protected void onCreate(Bundle savedInstanceState)
  14. {
  15. super.onCreate(savedInstanceState);
  16. setContentView(R.layout.activity_main);
  17.  
  18. featureServiceTable = new GeodatabaseFeatureServiceTable(FEATURE_SERVICE_URL, 0);
  19.  
  20. // Test log here
  21. Log.e(TAG, featureServiceTable.toString());
  22.  
  23. // Retrieve the map and initial extent from XML layout
  24. mMapView = (MapView) findViewById(R.id.map);
  25.  
  26. // Initialize this GeodatabaseFeatureService to fill it with features from the service.
  27. featureServiceTable.initialize(new CallbackListener<GeodatabaseFeatureServiceTable.Status>()
  28. {
  29. @Override
  30. public void onError(Throwable ex)
  31. {
  32. showToast("Error initializing FeatureServiceTable!");
  33. }
  34.  
  35. @Override
  36. public void onCallback(Status arg0)
  37. {
  38.  
  39. // Create a FeatureLayer from the initialized GeodatabaseFeatureServiceTable.
  40. featureLayer = new FeatureLayer(featureServiceTable);
  41.  
  42. // Emphasize the selected features by increasing selection halo size.
  43. featureLayer.setSelectionColorWidth(20);
  44. featureLayer.setSelectionColor(-16711936);
  45.  
  46. // Add the feature layer to the map.
  47. mMapView.addLayer(featureLayer);
  48. ...
  49. }
  50. });
  51. }
Add Comment
Please, Sign In to add comment