This is an archive related to a previous version of Esri Maps for SharePoint. If you need the current version go to http://doc.arcgis.com/en/maps-for-sharepoint/.

Measure, Print, and Query Related Records tools

Esri Maps for SharePoint includes three extensions for use with the ArcGIS Map Web Part: Measure, Print, and Query Related Records. These tools provide additional functionality and can be both customized and extended by Esri Maps for SharePoint users.

For developers, the full source code has been made public on ArcGIS Online and provides an example of an advanced tool implemented using best practices. To view the source code, download the samples from ArcGIS Online and open the solution file in Visual Studio. To debug the add-in, follow the instructions provided in the Deployment and Use Instructions text file included with the sample.

  • Measure tool—The implementation follows the Model View ViewModel (MVVM) pattern, shows how to interact with the map and add graphics programmatically, demonstrates how to make an add-in localizable, and more.
  • Print tool—The implementation demonstrates the Model View ViewModel (MVVM) pattern, interaction with the map, interrogation of layers, leveraging the ArcGIS API for Silverlight's print capabilities, localization, and more.
  • Query Related Records tool—The implementation follows the Model View ViewModel (MVVM) pattern, shows how to interact with pop-up window information, add and remove layers programmatically, and more.

Measure tool

The measure tool allows you to calculate measurements by drawing and measuring points, lines, circles, ellipses, rectangles, and polygons. The measure tool also provides the ability to get the measurements of features on the map. Linear and areal measurements can be retrieved in a number of different units.

Draw and measure geometries

  1. Add the Measure tool to a toolbar by following the steps in Add tools.
  2. Click the Measure button on the toolbar to open the Measure dialog box.
  3. Select the shape to draw. The available shapes, from left to right, are point, line, freehand line, rectangle, circle, ellipse, polygon, and freehand polygon.
    Measure tool dialog box
  4. Draw the shape on the map. When hovering the pointer over the map, a message appears next to the mouse cursor with instructions specific to the type of shape selected for drawing.
  5. Once a shape draws on the map, measurements calculate and display at the bottom of the Measure dialog box. To change the units used for the measurements, select the applicable unit from the drop-down menus that appear next to the measurements.

Measure features on the map

  1. Add the Measure tool to a toolbar by following the steps in Add tools.
  2. Click the Measure button on the toolbar to open the Measure dialog box.
  3. From the top of the dialog box, click the Select features to measure button. If this button is not visible, the map does not contain any measurable layers.
    Measure tool - Select features to measure
  4. From the Layer drop-down menu, select the applicable layer.
  5. If the selected layer is a map service layer, a subayer drop-down menu appears on the dialog box. If this is visible, select the applicable layer within the map service.
  6. Once a feature is clicked, measurements calculate and display at the bottom of the Measure dialog box. To change the units used for the measurements, select the applicable unit from the drop-down menus that appear next to the measurements.

Print tool

Esri Maps for SharePoint provides a custom, high-quality Print tool for the ArcGIS Map Web Part that uses the ArcGIS for Server 10.1 Print Service. By default, Esri Maps for SharePoint uses the Export Web Map task hosted on ArcGIS Online, but you can configure the Print tool to use your own ArcGIS Server Print Service and a proxy if necessary.

  1. Place the Map Web Part in Edit mode. See Edit mode and Run mode for instructions.
  2. Click Add Tool on the Application tab of the ribbon.

    The Add Tool dialog box appears.

  3. In the Tool drop-down menu, select ArcGIS Server Print. You will notice another Print tool listed in the menu; this is the existing Basic Print tool that does not include an option to print from an ArcGIS Server print service.
    Add ArcGIS Server Print tool
  4. Click Configure to display the Configure Print dialog box.
    Configure ArcGIS Server Print tool
  5. Check the Use ArcGIS Server Print Service check box.
  6. Specify the Print Service URL if you want to use one different from the default.

    You must specify the entire URL to the Print Service, for example, http://<server_name>/arcgis/rest/services/Utilities/PrintingTools/GPServer.

  7. Specify the other attributes on the dialog box and click OK. Note that the end users of the web part will not be able to configure this print tool; they only see the options configured here.
  8. Click OK again on the Add tool dialog box to close it.
  9. Click OK or Apply on the ArcGIS Map Web Part properties and the tool is added to the ribbon.

Query related records tool

Esri Maps for SharePoint supports finding a feature's related records. If the related records belong to a layer, the geometry of each related record returns and displays on the map as a point, polyline, or polygon. Additionally, the related records display in the attribute table. If the related records belong to a table, the records only display in the attribute table.

The query related records tool is located on the pop-up toolbar and queries the related records of the feature that is clicked. To use this functionality, on-click pop-ups must be enabled for the layer (this is enabled on feature layers by default). When the pop-up displays for a feature, the tool is enabled (visible) if a relationship for the service containing the feature is detected. If there is no relationship detected, the tool is unavailable. After executing the query (clicking the tool), the results return and display in the attribute table and also on the map, if applicable. If there are no related features, a message displays in the pop-up to indicate that no records were found. When the results of the query initially show on the map, they display as a temporary layer, and removed when another query is executed, or if the pop-up is closed. If you want to keep the results as a permanent layer on the map, check the Keep results on map check box.

Add the Query Related Records tool to the pop-up window

The Query Related Records tool is designed for use on the pop-up window, not the main SharePoint ribbon. In Esri Maps for SharePoint, you must edit the DefaultTools.xml file in the Esri Maps Configuration Files.

  1. Open the Default.xml file in the Esri Maps Configuration Files.
  2. Add the following xmlns declaration to the top of the DefaultTools.xml file: xmlns:QueryRelatedRecords="clr-namespace:QueryRelatedRecords.AddIns;assembly=QueryRelatedRecords.AddIns".

    Query Related Records xmlns declaration

  3. Add the following lines to the Popup Toolbar section f the DefaultTools.xml file: <Tool Label="Query Related Records" Icon="/_layouts/15/ESRI.ArcGIS.Mapping.SharePoint/images/GeodatabaseRelationshipSelect16.png" Description="Query the related records of the feature"><Tool.Class> <QueryRelatedRecords:QueryRelatedTool /> </Tool.Class></Tool>.

    Query Related Records Tool Element in DefaultTools.xml

  4. Save and close the DefaultTools.xml file.
  5. Download GeodatabaseRelationshipSelect16.png.
  6. Navigate to the Esri Maps Extensions library and upload the icon file from step 5. This icon appears on the pop-up window toolbar when the tool is enabled. Note that the tool is only enabled if related features are detected on the feature layer.

Query records

  1. Click a feature on the map. If the layer containing the feature has relationships, the Query Related Records tool appears in the pop-up toolbar.
    Query related tool on pop-up toolbar
  2. Click the tool to execute the query. The results of the query return and a temporary layer is created that displays the features as red points, lines, or polygons. If there are no related records for a feature, a message displays in the pop-up to inform the user. Note that closing the pop-up window or reexecuting the query removes the temporary layer.
  3. To add the results of the query to the map permanently (create a layer), check the Keep results on map check box. You can toggle this check box to specify whether to keep the results of each query on the map. Once a layer has been added to the map, you can work with it just as with any other layer, including removing, renaming, reordering, and configuring its look and feel (that is, symbology).
    Query related tool with Keep results on map option