Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- featureServiceTable = new GeodatabaseFeatureServiceTable(FEATURE_SERVICE_URL, 0);
- // Test log here
- Log.e(TAG, featureServiceTable.toString());
- 10-16 14:31:07.814 27896-27896/com.dev.mthaqifisa.remakejkptg E/MainActivity: GeodatabaseFeatureTable [Name=null, ID=-1, geodatabase=null]
- MapView mMapView = null;
- public GeodatabaseFeatureServiceTable featureServiceTable;
- final String FEATURE_SERVICE_URL = "http://www.....my/arcgis/rest/services/.../charting/MapServer";
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- featureServiceTable = new GeodatabaseFeatureServiceTable(FEATURE_SERVICE_URL, 0);
- // Test log here
- Log.e(TAG, featureServiceTable.toString());
- // Retrieve the map and initial extent from XML layout
- mMapView = (MapView) findViewById(R.id.map);
- // Initialize this GeodatabaseFeatureService to fill it with features from the service.
- featureServiceTable.initialize(new CallbackListener<GeodatabaseFeatureServiceTable.Status>()
- {
- @Override
- public void onError(Throwable ex)
- {
- showToast("Error initializing FeatureServiceTable!");
- }
- @Override
- public void onCallback(Status arg0)
- {
- // Create a FeatureLayer from the initialized GeodatabaseFeatureServiceTable.
- featureLayer = new FeatureLayer(featureServiceTable);
- // Emphasize the selected features by increasing selection halo size.
- featureLayer.setSelectionColorWidth(20);
- featureLayer.setSelectionColor(-16711936);
- // Add the feature layer to the map.
- mMapView.addLayer(featureLayer);
- ...
- }
- });
- }
Add Comment
Please, Sign In to add comment