Clear markup measurement vs sketch
When using the clear markup command I would like there to be options to clear only the temporary graphics for the measurement or only the temporary graphics for the drawing. Right now it clears both graphics at the same time.
I am aware of the arguments available for this command, this only give the possibility to specifically remove the labels of the measurement. I would like the vgs-sketching to be split up into e.g. vgs-sketching-measurement and vgs-sketching-drawing.
I have three clients who have this wish.
-
Official comment
Johanne van Linge You can get there today with a bit of re-configuration.
Instead of using the vgs- default collections, re-configure your drawing and measurement tools to use their own collection.
I did some quick testing to verify you can clear drawing and measurement (geometry + labels) independently with this approach and so I could provide you with command-chain samples.
You'll want to adjust the maps.add-markup and maps.clear-markup portions of your commands to put things into the collections that match how you want the application to work. For example:
[
{
"name": "sketching.capture-geometry",
"arguments": {
"geometryType": "polygon",
"pluginSettings": {
"snapping": true
}
}
},
"drawing.create-graphics",
{
"name": "map.add-markup",
"arguments": {
"collection": "custom-drawings"
}
}
][
{
"name": "map.clear-markup",
"arguments": {
"collection": "custom-drawings"
}
}
][
{
"name": "measurement.capture-geometry",
"arguments": {
"geometryType": [
"polygon",
"polyline"
],
"pluginSettings": {
"snapping": true
}
}
},
"measurement.create-graphics",
{
"name": "map.add-markup",
"arguments": {
"collection": "custom-measurement"
}
}
][
{
"name": "map.clear-markup",
"arguments": {
"collection": "custom-measurement"
}
}
] -
Hi Cam,
Thanks for you response. I have applied this to a viewer in our environment and it works. The only addition I did was with the clearing of the custom-measurement, I also added clearing the vgs-measurement-labels.
0 -
Hi Cam and Johanne,
I followed Cams instructions, and added clearing the vgs-measurement-labels as Johanne suggested. Unfortunately, if I perform multiple measurements before clearing the markups, only the labeling of the last measurement is deleted, the older ones remain on the map. Any suggestions?
Thanks in advance!
[
{
"name": "map.clear-markup",
"arguments": {
"collection": "custom-measurement"
}
},
{
"name": "map.clear-markup",
"arguments": {
"collection": "vgs-measurement-labels"
}
}
]1 -
I have the same issue as Holger. Wanted to add that the command map.clear-markup (without args) also does not remove the labels.
Was a solution provided?
0 -
Hi Matthew,
They're working on it. I received the following message on January, 4th:
"We were able to reproduce the error/concern. For further processing, we have transferred the ticket to the responsible development team, which will further take care of the case with the number 250669."
1 -
Hi Matthew and Holger,
I completely forgot to follow-up but I experienced the same issue with the labels still sticking around. Therefore I have undone this implementation and for now we are just working with the predefined clear all markup.
Thanks for the update from both of you. Hopefully they will fix this so we can implement this!
0 -
We hope this will get fixed too. We also hope the fix will include the clearings of notes separately.
0 -
Cam Barnard. Is this fix on the roadmap?
0 -
Olivia Bang Brinck Looks like it was resolved as part of the 5.28 release ~February 2024.
0 -
Cam Barnard. Thanks for the answer. I got it working now. But is it correctly understood that it is still not possible to clear notes separately? In the command reference i was not able to find the argument collection for the "map.create-note" command. Is there something I am missing?
0 -
Cam Barnard
I modified my drawing tools, measuring tools, Buffer Tools, and Note Tool using the collection parameter. Now when I use the Edit Markup Tool it doesn't select the Drawings or Measurements on the map.
Here is my code for the drawing tool which all are using "collection": “custom-drawings”, and measurements are using "collection": “custom-measurement”.
[ { "name": "sketching.capture-geometry", "arguments": { "geometryType": "extent", "pluginSettings": { "snapping": true }, "symbol": { "type": "esriSFS", "color": [ 150, 150, 150, 0 ], "style": "esriSFSSolid", "outline": { "color": [ 14, 94, 231, 255 ], "width": 1.5, "style": "esriSLSSolid", "type": "esriSLS" } } } }, "drawing.create-graphics", { "name": "map.add-markup", "arguments": { "collection": "custom-drawings" } } ]Edit Markup Tool - OOB
[ { "name": "sketching.capture-geometry", "arguments": { "geometryType": [ "point", "extent" ] } }, "map.get-markup", { "name": "sketching.edit-geometry", "arguments": { "options": { "enableDelete": true } } } ]0 -
Olivia Bang Brinck
Here is what I used for clearing note graphics. I am just using OOB Add Location Note for text graphics.
[ { "name": "map.clear-markup", "arguments": { "collection": "vgs-map-notes" } } ]0 -
If you want to use the Edit Markup Tool when you use collections you will need to configure an Edit Markup Tool for each collection. Below is an example of what the syntax is for the Drawing tools.
[ { "name": "sketching.capture-geometry", "arguments": { "geometryType": [ "point", "extent" ] } }, { "name": "map.get-markup", "arguments": { "collection": "custom-drawings" } }, { "name": "sketching.edit-geometry", "arguments": { "options": { "enableDelete": true } } } ]0 -
I realize this thread is a few months old, but I wanted to ask an additional question. I have used the “collection” method to add custom “Clear XXXX” buttons (i.e. Clear Drawings, Clear Measurements, etc.). However, I also had a “Drawing Style” tool associated with my Draw tools, but that no longer seems to register the changes made in drawing styles. Only the default drawing style is used, regardless of changes I make in the Drawing Style tool. I assume I somehow need to tie in the “collection”: “custom-drawings” parameter, but so far my efforts have not worked.
Is this possible? Thanks!
0 -
I have also used the "collection" method to separate drawings, measurements and notes.
How do edit the command for exporting everything to a shape file?
[
"map.get-markup",
"results.from-graphics",
"results.convert-to-shapefile",
"system.download-file"
]
0
Please sign in to leave a comment.
Comments
15 comments