Display online and offline layers

4196
5
02-01-2015 11:01 PM
HassanShatnawi
New Contributor

Hello every body

how do i display online layer below of offline layer

Online Layer

ArcGISTiledMapServiceLayer tileLayer = new ArcGISTiledMapServiceLayer(

  "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");

  mMapView.addLayer(tileLayer);

Offline Layer from .geodatabase

Geodatabase geodatabase = new Geodatabase(Environment

  .getExternalStorageDirectory().getPath()

  + "/ArcGIS/samples/OfflineRouting/Routing/5512.geodatabase")

;geodatabaseFeatureTablesList = geodatabase.getGeodatabaseTables();

for (int i = geodatabaseFeatureTablesList.size() - 1; i >= 0; i--) {

addLayer();

}

Edit :

Please note that I'm using Esri-android-Sdk

0 Kudos
5 Replies
TeroRönkkö
Occasional Contributor

This works:

for (GeodatabaseFeatureTable gdbFeatureTable : localGdb

                    .getGeodatabaseTables()) {

                if (gdbFeatureTable.hasGeometry()){

                    FeatureLayer fl = new FeatureLayer(gdbFeatureTable);

                    mMapView.addLayer(fl);

So I guess in your example it would be

FeatureLayer fl = geodatabaseFeatureTableslist;

mmapview.addLayer(fl);

0 Kudos
HassanShatnawi
New Contributor

is this will display layers from .geodatabase above this layer

  1. ArcGISTiledMapServiceLayer tileLayer = new ArcGISTiledMapServiceLayer( 
  2.   "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); 
  3.   mMapView.addLayer(tileLayer); 
0 Kudos
TeroRönkkö
Occasional Contributor

I am not quite sure what you mean? But I am refering to your last example in the first post. The one above is online layer.

0 Kudos
HassanShatnawi
New Contributor

first I'm appreciate your response

let me try to do more explanation for what I wont

-------------------------------------------------------------------
I have an online layer like my comment above I add it to MapView

so can I read layers from offline .geodatabase file stored on SDcard and add it above the online layer so I can see my offline layer and out of its bound there will be an online layer

0 Kudos
TeroRönkkö
Occasional Contributor

Yes, I believe it will be shown on top of your online layer if you just add it to mapview after it as a featurelayer. Is that your question?

1. Add Baselayer (streetmap as in above)

2. Add Featurelayer from geodatabase

0 Kudos