Hi Ian,For the Meters/Feet issue, the variable you need is set in the MeasureViewModel.cs file. Look near the top and you'll see the Linear and Areal default units (I've attached a screenshot). Change the LinearUnit = LengthUnits.UnitsFeet instead of LengthUnits.UnitMeters. Then compile the solution, remove the existing Measure tool from the Application Builder, and upload the newly compiled Xap file. You may need to refresh your Browser. For the coordinates issue, you'll need to edit the MeasureView.xaml file. Find the following bits and change the StringFormat attribute. For example, where it says {0:n2\}, change the "n2" to "n5" or the desired number of digits after the decimal.**Note - if you already have a version of the Measure Tool from ArcGIS Online, we've made a small update to it today, so please re-download it. <!-- Latitude value --> <TextBlock Margin="5,5,0,0" Text="{Binding Path=Latitude, StringFormat=\{0:n2\}}" Visibility="{Binding Latitude, Converter={StaticResource NotNullToVisibilityConverter}}" Grid.Row="1" Grid.Column="1"/><!-- Longitude value --> <TextBlock Margin="5,5,0,0" Text="{Binding Longitude, StringFormat=\{0:n2\}}" Visibility="{Binding Longitude, Converter={StaticResource NotNullToVisibilityConverter}}" Grid.Row="2" Grid.Column="1"/>Hope that helps,Katy
Hi Ian,You'll need to download the Measure Tool sample from ArcGIS Online. After you unzip the file, you'll see that it includes the full source code for the Measure tool, exactly as it is included in the Application. You'll need to make the edits as described in my earlier post, and then rebuild the solution. The resulting .xap file is what you will then load into the ArcGIS Viewer for Silverlight in the same manner as you would other add-ins. Katy
Hi Ian:The xap in the root of the zip file will not be updated when you compile the source. Rather, you'll need to copy the add-in's xap file from the output location under the Source Code folder (i.e. Source Code\MeasureTool\MeasureTool.AddIns\Bin). The xap should be contained in a Release or Debug folder in that location, depending on whether you have compiled the add-in using the Debug or Release configuration.However, if the MeasureTool.AddIns project is failing to load when you open the project in Visual Studio, then you probably lack some pre-requisites for developing Viewer add-ins. You'll need to install the Microsoft Silverlight 5 Tools for Visual Studio 2010 and the latest Silverlight Toolkit.
If the xap file is present in the Debug folder, then it is compiling - that xap file contains your changes. Now that you have it, you need to replace the version in the Application Builder with the new version. To do this:Open the Application BuilderClick the Settings link (upper right)Click the Add-Ins tabNext to MeasureTool.AddIns, click the delete button. Confirm the deletion when prompted.Clear your browser cache. If you are using Internet Explorer, the most reliable way is to open a command prompt and input the command "rundll32.exe inetcpl.cpl,ClearMyTracksByProcess 8"Refresh the browser pageNavigate to Settings --> Add-Ins againClick the "Upload Add-Ins" buttonBrowse to your compiled version of the MeasureTool.Addins.xap file. Make sure you select the one under the Debug folder.Create a new app and add the Measure Tool to it. When you try it out, you should see your changes.That should do it for you.
Could someone please upload a .XAP of a measure tool with Feet as the default measurement?
This add-in has the measuring units defaulted to feet. I worked on this file back in October. Let me know if this works.
Ian,
Did you even update to a newer version of Silverlight viewer and find that it did not work anymore? I went from 3.0 to 3.3 and the measure tool no longer works. I am trying to modify it in Visual Studio but it says my Silverlight version is not high enough. I'm at version 4. If I download 5 it tells me it is already installed. Long story short, you wouldn't happen to have a .xap file that works with 3.3 would you?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.