Marker option in SimpleLineSymbolJson
I would like to be able to use the option of a marker within a SimpleLineSymbolJson.
I would like to be able to sketch a line as an arrow in a Web application. I see others have requested this as well as an option in skteching, I upvoted the idea. https://support.vertigis.com/hc/en-us/community/posts/22065772016018-Extra-sketch-symbols-Arrow-and-others
In the meantime I have been looking at doing it myself with the sketching.capture-geometry operation in Web. I see in the documentation of the arguments for this, the symbol can be any of x, including SimpleLineSymbolJsonesri.rest-api.SymbolJson.SimpleLineSymbolJson.
https://developers.vertigisstudio.com/docs/web/api-argument-definitions/#definition-CaptureGeometryArgs & https://developers.vertigisstudio.com/docs/web/api-argument-definitions/#definition-esri.rest-api.SymbolJson.SimpleLineSymbolJson
When working with a json like underneath I get the response that “Property marker is not allowed”.
{
"type": "esriSLS",
"color": [
0,
122,
194,
255
],
"width": 1,
"style": "esriSLSSolid",
"marker": {
"placement": "begin",
"type": "line-marker",
"style": "arrow",
"color": [
0,
122,
194,
255
]
}
}I have had contact with support regarding the error "Property marker is not allowed." when using the sketching.capture-geometry command:
- This has actually been documented as a bug, but not yet implemented (it only has the status "Validated").
- The ID is 257781.
Support said:
The following command sequence could be a workaround, though the markup line symbol would then be stuck as an arrow until it was changed:
[
{
"name": "drawing.set-default-symbol",
"arguments": {
"type": "esriSLS",
"color": [
75,
75,
75,
255
],
"width": 1.5,
"style": "esriSLSSolid",
"marker": {
"placement": "end",
"style": "arrow"
}
}
},
{
"name": "sketching.capture-geometry",
"arguments": {
"geometryType": "polyline"
}
},
"drawing.create-graphics",
"map.add-markup"
]And when drawing it does show an arrow as a line … so it seems that the application does support it in that way. But I'd prefer not to have to use a workaround with other possible backlash of issues.
-
Did a bit of research, to get the default line symbol “unstuck” as an arrow, you can reset the default symbol back to the original (as long as you know the settings for it). You can just use this code in that Arrow drawing command, but change the symbology to what you want (both for the arrow at the top as for the default at the bottom)
[ { "name": "drawing.set-default-symbol", "arguments": { "type": "esriSLS", "color": [ 75, 75, 75, 255 ], "width": 1.5, "style": "esriSLSSolid", "marker": { "placement": "end", "style": "arrow" } } }, { "name": "sketching.capture-geometry", "arguments": { "geometryType": "polyline" } }, "drawing.create-graphics", "map.add-markup", { "name": "drawing.set-default-symbol", "arguments": { "type": "esriSLS", "color": [ 75, 75, 75, 255 ], "width": 1.5, "style": "esriSLSSolid" } } ]0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire