Is there a way to retrieve the name of the specific sublayer of the service the SOI is receiving a request for through the Java SDK? The handleRESTRequest function takes the resourceName parameter which specifies the sublayer index (i.e. ‘layers/23’) of the request. How can I retrieve the title of that sublayer as a string?
Solved! Go to Solution.
You can get the layer name from IMapLayerInfo.getName().
IMapServer ms=(IMapServer)this.soHelper.getServerObject();
IMapServerInfo mapServerInfo = ms.getServerInfo(ms.getDefaultMapName());
IMapLayerInfos layerInfos = mapServerInfo.getMapLayerInfos();
Loop through the IMapLayerInfos and you can find each layer's layer ID (IMapLayerInfo.getID()) and layer name (IMapLayerInfo.getName()). Based on the ID-Name pairs, you can return the layer name given the ID/index from the resourceName for each request.
You can get the layer name from IMapLayerInfo.getName().
IMapServer ms=(IMapServer)this.soHelper.getServerObject();
IMapServerInfo mapServerInfo = ms.getServerInfo(ms.getDefaultMapName());
IMapLayerInfos layerInfos = mapServerInfo.getMapLayerInfos();
Loop through the IMapLayerInfos and you can find each layer's layer ID (IMapLayerInfo.getID()) and layer name (IMapLayerInfo.getName()). Based on the ID-Name pairs, you can return the layer name given the ID/index from the resourceName for each request.
@Anonymous User Thanks much for your feedback! We were able to successfully get those suggestions implemented.