If I load up a webmap into a MapView, and then go ahead and get a reference to a particular layer in it, I can then log out the service url of the associated feature table.
e.g.
console.log(layer.featureTable.url)
I then go ahead and use the OfflineMapTask to take that web map offline into a mobile map package. Then I load up that same mmpk into a MapView. I get a reference to the same layer and try to log out the url but get "undefined".
If I open up the "mobile_map.mmap" file from the mmpk in a text editor, I can see that all the service urls do exist in there, so the information is brought offline, I just don't know how to surface that information.
Does anyone know how to access the original service url of a layer from the mmpk, given this workflow?
cheers,
-Paul
Solved! Go to Solution.
Hi Paul,
I think the way to do this is by accessing the serviceUrl property of the geodatabase which provides the data for the offline feature layer.
One approach to get to that would be something like:
- get the operationalLayers from the map
- find the layer you are interested in
- cast the layer to a feature layer and get it's featureTable
- cast the feature table to a geodatabase feature table
- access the geodatabase property of the table
I hope that's helpful,
Luke
Hi Paul,
I think the way to do this is by accessing the serviceUrl property of the geodatabase which provides the data for the offline feature layer.
One approach to get to that would be something like:
- get the operationalLayers from the map
- find the layer you are interested in
- cast the layer to a feature layer and get it's featureTable
- cast the feature table to a geodatabase feature table
- access the geodatabase property of the table
I hope that's helpful,
Luke
Thanks Luke - yes that seems to work, thank you!