Select to view content in your preferred language

measure tool issues

420
3
06-09-2011 11:19 AM
DanielSchatt
Regular Contributor
hi all, I'm trying to use the measure tool from the Utility Actions sample.  It works fine as the original button but now I'm trying to put it as a tool in my toolbar.  So I'm putting the trigger event code snippet within that toolbar item as below, but it isn't working - it just pans the map after I click it instead of activating the measure tool:

<esri:ToolbarItem Text="Measure">
       
<esri:ToolbarItem.Content>
  <Image Source="http://139.70.26.131:8008/images/measure.png" Stretch="None" Margin="5" /> </esri:ToolbarItem.Content>
       
<i:Interaction.Triggers>
     <i:EventTrigger EventName="Click">
           <esri:MeasureAction                                 
                AreaUnit="Acres"
                DisplayTotals="True"
                DistanceUnit="Feet"
                MapUnits="Meters"
                MeasureMode="Polygon"                                  
                FillSymbol="{StaticResource measureDefaultFillSymbol}"
                TargetName="ShorelineAssessmentMapperMap"/>
     </i:EventTrigger>
</i:Interaction.Triggers>
        
</esri:ToolbarItem>

Can anybody tell me what I'm doing wrong?

Also, I noticed this tool gives the units of measure when it shows area measurements, but not when showing length measurements.  It just displays a number.  Is there a way to make it show length units?

Thanks much for any assistance!

Dan
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
You want to put the Interaction.Trigger inside Image and replace EventName with MouseLeftButtonDown or replace Image with a Button that has Click event. The lengths do not display unit of measurement, but area does display the unit squared.
0 Kudos
DanielSchatt
Regular Contributor
Thanks, Jennifer!  Sorry, can you tell me how I place the Interaction.Triggers code inside Image?  Image doesn't seem to have a close tag like ToolbarItem or Button so I'm not quite sure where to put the Interaction.Triggers block of code.

Also, is there no way to add functionality have length units displayed as you're using the measure tool, just as the area units are?

Thanks again for your help...

Dan
0 Kudos
DanielSchatt
Regular Contributor
so sorry, Image does have a close tag you can use!  So i was able I put my trigger code block inside the Image and it works great.  Thanks Jennifer..

But I just don't understand why length units aren't displayed as you measure, just as the area units are.  I think this is really important.  If anyone has any idea how to do this...thanks!

Dan
0 Kudos