According to documentation, to have layer legend info available for your ArcGISDynamicMapServiceLayer you must call retrieveLegendInfo() method on this layer instance. Also it must be called in separate thread. The following seems to be good approach:
mapView.setOnStatusChangedListener(new OnStatusChangedListener() {
@Override
public void onStatusChanged(Object o, STATUS status) {
if (status == STATUS.LAYER_LOADED) {
if (o instanceof ArcGISDynamicMapServiceLayer) {
//retrieving legend info
new AsyncTask<Void, Void, Void>() {
protected Void doInBackground(Void... voids) {
dynamicLayer.retrieveLegendInfo();
return null;
}
}.execute();
});
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.