How does one clear feature focus in the viewer?
I have a workflow that runs from a maptip and may update the geometry of the feature that the maptip is called from, which updates the geometry on the map but not the "focus" markup on the map. So, I need to clear the old focus and maybe apply a new one.
Here are my problems. I've tried the "ClearHighlights", "ClearFeatureFocus", and "ClearFeatureHighlights" commands with the maptip feature passed into my workflow using the {$Feature} token as an argument, but the focus doesn't seem to go anywhere. Does anyone know what step I'm missing?
Furthermore, I've been able to add feature focus markup to a modified essentials feature using the "FocusFeature" command on an essentials feature, copied from the input meantioned above but with the "_graphic" and "esriFeature.value" properties updated. The Focus draws just fine, but does not disappear. I would like it to basically be an update of the mapTip's markup, so that it disappears on a map click. What am I missing?
-
I think the issue is that maptip highlights and aren't meant to be affected by viewer highlight/focus commands. That way if you're opening, closing, or changing the viewer's results list/table which while you have a map tip open, the map tip highlight isn't lost. Would it work in this case to have the workflow run the InvokeMapTip command using the same geometry that was used to update the feature? That would open a new map tip on the new geometry, which should dismiss the old one.
0 -
InvokeMapTip is resetting the geometry, thank you, but it also is picking up overlapping features and the nature of this data guarantees at least two layers will overlap on all of the features from which the workflow is run and who knows which layer will show up first.
@Amanda Frech?, in Essentials workflow we are able to set the showMapTip property of a GCE layer with the "Set Layer Property" activity, but the seeming replacement for this activity in WF5 doesn't take an input to specify sublayer and thus won't be able to do this. Do you know of another way to enable/disable map tips for a GCE layer? That would be a workaround.
0 -
@Zack Robison? This is technically possible, but a bit tricky
I used the Get Essentials Site activity, and logged out the results. Once I found the index for the service and layer I wanted to test on, I used Set Property like this:
Object: =$site1.site.essentialsMap.mapServices[1].layers[0]
Property Name: showMapTips
Property Value: =true
To use that in practice, you'd probably want a method to find the map service and layer in that object based on names or ids instead of index. A "Set Essentials Layer Property" or "Get Essentials Layer" activity would be good suggestions for the Ideas board to make the process easier.
0 -
Thank you, that method works! Unfortunately I realize now that I have a lot of overlapping features in the same layer too and so this didn't work.
I played with the ShowMapTip command some more and have finally gotten a workflow that does exactly what I need. I can't get the viewer to create a new feature for me, but I can use the {$Feature} token to input the existing feature. I update its geometries as described above for feature focus and then run the command.
I've noticed some difficult behavior with these map tips in that if you don't clear them before running the next command they will stay in the viewer until reloaded, and I've been unable to be rid of them in any other way which is not good. Running HideAllMapTips first seems to avoid the problem entirely though; so I surmise that there is a disconnect between drawing and clearing mapTips which needs to be handled with care when using these commands in a workflow.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer