Add Measurement tool to Map Context Menu in HTML5 Viewer
I would like to add a measurement tool to the map context menu (right-click menu) in my HTML5 Viewer. Measure Line would be great. I used to accomplish this in the Silverlight Viewer by adding a batch item to the menu:
e.g.
<Menu Id="MapMenu">
<Items>
<Item Text="Identify" Command="Identify" />
<Item Text="Measure Distance">
<Batch>
<BatchItem Command="ShowAdvancedTools" />
<BatchItem Command="SetCurrentTab" CommandParameter="Tasks" />
<BatchItem Command="ActivateTool" CommandParameter="MeasureDistance" />
</Batch>
</Item>
</Items>
</Menu>
In the HTML5 Viewer (I'm using version 4.12.2 with Essentials 4.12) I don't see an option to add batch items. I tried using SetActiveTool and put in the CommandParameter "MeasureDistance" but that doesn't work.
It seems like it should be simple - can anyone help me out with this please?
Thanks,
Stephanie
0
-
Hi Stephanie,
You're right, it is fairly simple and you were very close to solving it yourself using the SetActiveTool command. However, the Command Parameter to measure distance is 'MeasureDistanceTool' and for areas it is 'MeasureAreaTool'.
I got this info from Brian Oevermann's helpful comment in this thread:
https://support.geocortex.com/essentialsGSCForumDetail?sub-nav=forum&main-nav=essentials&id=0D5f200006aOfOeCAK
Also note that Brian listed the system icons that you can use for these tools, as below:
Resources/Images/Icons/Toolbar/measure-distance-24.png
Resources/Images/Icons/Toolbar/measure-area-24.png0 -
Amazing! Thank you so much Lindsay, I really appreciate you taking the time to answer this. "MeasureDistanceTool" worked perfectly. Thanks! 0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer