I have attached the webmap json as a text file.
Any help would be greatly appreciated.
Solved! Go to Solution.
I can see the issue is that only one of the attributes of the feature layer have been passed into the json so the labeling attribute is missing so I am trying to figure out what controls the attributes passed through into the webmap json
Update: the only attribute included in the featureSet seems to be the one used in the unique value renderer. I cannot find a way to include other specified attributes in the layer featureSet in the json when the feature layer has been created dynamically from graphics. If not, there is no way to print labels for these feature layers unless the label attribute happens to be the same field as has been included in the webmap json.
This was all you needed to know about the different software testing approaches! Now, it is up to you to decide which of these software testing approaches by mlsdev.com/services/mobile-app-development will work for your company. Either way, you can rest assured that your software will always be up-to-date and error-free. Happy software testing!
Hi @DaveAdams, this is an interesting issue. Could you share some code or a test-app that reproduces this behavior? I would like to see how you create the labels for the featureLayer so that they can display but not print.
Is the behavior any different if you use the ArcGIS Online utility print service?
Hi @Noah-Sager - I have investigated more today and have learnt more about the issue. I have tried multiple print servers (e.g. https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%...) but the problem is all about the content of the webmap json. The problem feature layer labels are defined here and applied to the layer:
The problem layer is a dynamic layer loaded from graphics I built from json data. The problem occurs when I have applied a unique-value renderer in the layer which means that the resulting featureSet for the points only includes the geometry and the single attribute which is being used for rendering. The attribute used in the map for labeling i.e. 'sequence_no' is missing and hence the labeling does not work in the print export.
As a contrast there is another dynamic layer (polygons but with the same attributes) in my sample file which has a simple renderer applied and that featureSet includes all the attributes in the feature layer.
"general_text": "Break-in at Honeysuckle Cottage", etc
If I manually add the attribute into the json for the points then the print service correctly prints the labels.
Really I think the creation of webmap json should detect if there are any labels active on a layer and ensure that attribute is included rather than just the one used for rendering.
Hopefully that explains a little more. I am currently trying a workaround (with some success) by intercepting the file using esriConfig.request.interceptors.push : BeforeInterceptorCallback to try and transfer some attributes i.e. the label attribute from the other layer in the file which luckily matches in schema. Without the other layer I would have nothing to help create some label values.