You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the Map object content property (MapContent object) update_layer() method to update the layerDefinition property, you cannot specifically choose which layerDefinition properties to update it overwrites the entire layerDefinition. For example, I update the layerDefinition minScale and maxScale to alter the scale range, the entire layerDefinition is overwritten removing any drawingInfo, filterExpression etc. If this is by design it is poorly documented.
To Reproduce
Steps to reproduce the behavior:
Here's the layer definition
@Clubdebambos Thanks for reporting this however I don't feel this is a bug but rather an enhancement.
The update will take the options dictionary, see if the attributes are in the layer and, if yes, assign the value given. So this updates the definition to the value given by the user.
It seems for layer definition this may be too radical of an update and I see why a user would want to pass in just a key, value rather than the whole definition.
We can look at either adding a new parameter or having the method recognize if 'layerDefinition' is passed into option dictionary and treat it differently.
Do you have an opinion on which workflow would be of preference?
Also please feel free to provide feedback if you believe there is a more straightforward way to provide this to the user as we are open to discussion on this.
Hi @nanaeaubry,
The options parameter is certainly an enhancement. I think it would be great to be able to target single elements in the layerDefinition, for example; I want to update the scale ranges only, or the definitionExpression, rather than having to manipulate the layerDefinition and then use the entire layerDefinition to update.
"... or having the method recognize if 'layerDefinition' is passed into option dictionary and treat it differently."
It would be great if the options parameter recognizes the user is accessing and updating the layerDefinition, and only updates the components that the user has set.
Describe the bug
When using the Map object content property (MapContent object) update_layer() method to update the layerDefinition property, you cannot specifically choose which layerDefinition properties to update it overwrites the entire layerDefinition. For example, I update the layerDefinition minScale and maxScale to alter the scale range, the entire layerDefinition is overwritten removing any drawingInfo, filterExpression etc. If this is by design it is poorly documented.
To Reproduce
Steps to reproduce the behavior:
Here's the layer definition
Let's update the filterExpression
error:
No error code. The JSON definition is cleared for layerDefinition with the exception of the update.
"layerDefinition": {
"definitionExpression": "COUNTY = 'KILDARE'"
}
Screenshots
If applicable, add screenshots to help explain your problem.
Expected behavior
I expect the filterExpression to be updated and the rest of the properties in the layerDefinition to remain as they were
Platform (please complete the following information):
Additional context
Add any other context about the problem here, attachments etc.
The text was updated successfully, but these errors were encountered: