Custom layer styles on user-added dynamic layers are not loading in saved projects
Hello,
I created a custom module, allowing you to add a map service containing a dynamic layer, by extending the viewer. This dynamic layer is set up with a dynamic definition that defines its drawing info renderer (see below). The layer draws correctly with the expected style. The layer does not have any predefined styles set up for it.
When you change the visualization options using the Visualization tool from the layer menu, save the project, and reopen the project, the layer draws with the original style that is defined in the dynamic definition, not the custom style I created.
Does the dynamic definition drawing info get applied after the custom layer style? Is there something I need to programmatically set on the layer to tell it to use the layer style when one is selected instead of the dynamic definition drawing info?
Any insight on how layer styles work would be helpful.
Thanks!
dynamic definition being set:
{
"id": 10999,
"definitionExpression":"line = 10",
"source":{
"type":"mapLayer",
"mapLayerId":2
},
"drawingInfo": {
"renderer": {
"type":"uniqueValue",
"field1":"STOP_CLASS",
"defaultSymbol":null,
"uniqueValueInfos":[
{
"value":"S",
"symbol":{
"type":"esriSMS",
"color": [255,0,0,255],
"angle":0,
"xoffset":0,
"yoffset":0,
"size":9,
"style":"esriSMSCircle",
"outline":{
"type":"esriSLS",
"color":[255,0,0,255],
"width":1.75,
"style":"esriSLSSolid"
}
},
"label":"Stop"
},
{
"value":"T",
"symbol":{
"type":"esriSMS",
"color": [255,0,0,255],
"angle":0,
"xoffset":0,
"yoffset":0,
"size":9,
"style":"esriSMSCircle",
"outline":{
"type":"esriSLS",
"color":[
0,
0,
0,
255
],
"width":1.75,
"style":"esriSLSSolid"
}
},
"label":"Timepoint"
},
{
"value":"CS",
"symbol":{
"type":"esriSMS",
"color":[255,0,0,255],
"angle":0,
"xoffset":0,
"yoffset":0,
"size":9,
"style":"esriSMSDiamond",
"outline":{
"type":"esriSLS",
"color":[255,0,0,255],
"width":1.75,
"style":"esriSLSSolid"
}
},
"label":"Courtesy Stop"
},
{
"value":"CT",
"symbol":{
"type":"esriSMS",
"color":[255,0,0,255],
"angle":0,
"xoffset":0,
"yoffset":0,
"size":9,
"style":"esriSMSDiamond",
"outline":{
"type":"esriSLS",
"color":[
0,
0,
0,
255
],
"width":1.75,
"style":"esriSLSSolid"
}
},
"label":"Courtesy Timepoint"
}
]
}
}
}
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer