Problems with Running Viewer Commands
Hi. I'm having some problems with the 'Run Command' activity. My workflow, involves the user creating a new feature (or sometimes, multiple features), and at the end, I'd like to zoom to the new feature and highlight it, or add a pushpin or something like that to indicate to end user that the feature was successfully created.
The zooming part works fine. Regarding highlighting, I have tried several variations, including 'HighlightFeature', 'ClearAndHighlightFeature' and 'AddPushpin'. All of these take a feature as the parameter, and I'm providing a valid feature, but with limited success. The first 2 work intermittently. The 'AddPushpin' command always throws an error - "Cannot read property 'get' of undefined".
Anyone know what's up with these viewer commands?
Thanks?
-
Yes, i also found this. I'm thinking not all these commands are implemented in WF5?
As highlightFeature, i use FocusFeature as an alternative.
?
Cheers,
Minbin?
0 -
FocusFeature works great. Thanks Minbin.?
0 -
I'd recommend steering clear of highlight commands if possible. A bunch of them were deprecated in 2.8, and some of them are designed to work with Geocortex Features instead of Esri Graphic objects. You'll also have to watch out for unwanted interactions from the results list/table.
My recommendation would be to use the Add Graphics Layer Features activity, or the markup commands (eg, AddMarkupGeometry) instead when you need to draw features on the map.
0 -
Ok, thanks for the info Amanda. I did find that FocusFeature viewer command is flakey, like the other ones that deal with highlighting.
?So, sounds like I have 2 options:
1) Add graphics layer activity
2)AddMarkupGeometry. With this option, can you give an example or point me to documentation of how I would specify the symbol to use? By default its a blue circle for point geometry. I'd like to mimic the highlight symbol or something close to that. Thanks.
0 -
Hi Zobra,
The markup geometry commands don't accept any parameters for symbology, rather they use the current markup style defined by the viewer (ether from the drawing tool, or from the viewer's default). To change the viewer's default markup symbology:
- Navigate to the viewer's dekstop config file. The default location is: C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sites\SITENAME\Viewers\VIEWERNAME\VirtualDirectory\Resources\Config\Default\Desktop.json.js
- Backup the file and edit the original in a text editor like Notepad
- Use CTRL + F to search for "defaultPointMarkup".
- Change the "pointColor" property. The first two digits are for alpha, then red, then green, then blue. The line and polygon markup options are a few lines below as well if you're planning to use markup with lines or polygons.
- Save the file and test in the viewer
- Repeat for Tablet.json.js and Handheld.json.js if necessary
0 -
Got it. I ended up using the add graphics layer option as its fairly simple to create a symbol from json. Good to know about other options though. Thanks?
0
Please sign in to leave a comment.
Comments
6 comments