Skip to content

Commit

Permalink
refactored layers to use string resources and better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
doneill committed Nov 3, 2015
1 parent c6b93a5 commit 4d227b6
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,40 +59,36 @@ public class AttributeEditorActivity extends Activity {
// arcgis components
MapView mapView;
ArcGISFeatureLayer featureLayer;
ArcGISDynamicMapServiceLayer dmsl;
ArcGISDynamicMapServiceLayer operationalLayer;
Point pointClicked;
Envelope initextent;

// android components
LayoutInflater inflator;
AttributeListAdapter listAdapter;
ListView listView;
View listLayout;

public static final String TAG = "AttributeEditorSample";

static final int ATTRIBUTE_EDITOR_DIALOG_ID = 1;

@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);



mapView = new MapView(this);
initextent = new Envelope(-10868502.895856911, 4470034.144641369,
-10837928.084542884, 4492965.25312689);
mapView.setExtent(initextent, 0);
ArcGISTiledMapServiceLayer tmsl = new ArcGISTiledMapServiceLayer(
"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
mapView.addLayer(tmsl);
ArcGISTiledMapServiceLayer basemap = new ArcGISTiledMapServiceLayer(getResources().getString(R.string.basemap));
mapView.addLayer(basemap);

dmsl = new ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer");
mapView.addLayer(dmsl);
operationalLayer = new ArcGISDynamicMapServiceLayer(getResources().getString(R.string.operational_layer));
mapView.addLayer(operationalLayer);

featureLayer = new ArcGISFeatureLayer(
"http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/FeatureServer/0",
MODE.SELECTION);
getResources().getString(R.string.feature_layer),
MODE.SELECTION);
setContentView(mapView);

SimpleFillSymbol sfs = new SimpleFillSymbol(Color.TRANSPARENT);
Expand Down Expand Up @@ -355,7 +351,7 @@ public void onCallback(FeatureEditResult[][] result) {
// updated features
if (updateLayer) {

dmsl.refresh();
operationalLayer.refresh();

}
}
Expand Down

0 comments on commit 4d227b6

Please sign in to comment.