How do you add a local geodatabase to an offline map?

2184
2
03-10-2016 05:22 PM
ShaneFeirer
New Contributor III


I have found the example of adding an offline tilepackage to an offline map, but I have not been able to find an example of adding an offline (local) geodatabase to a map in appstudio.  Any help/examples would be greatly appreciated.

0 Kudos
2 Replies
SathyaPrasad
Esri Contributor
0 Kudos
KrisFoster
New Contributor III

Hi Shane,

Here is how I did it.

//Load the layers from our local geodatabase

function loadLayers(){

  if (gdbPath) {

  var gdbtables = gdb.geodatabaseFeatureTables;

  for(var i in gdbtables) {

  var newFeatureLayer = ArcGISRuntime.createObject("FeatureLayer");

  newFeatureLayer.featureTable = gdbtables;

  map.insertLayer(newFeatureLayer, 1);

  }

  }

}

Geodatabase {

  id: gdb

  path: gdbPath

}

0 Kudos