Developing Web Applications with the Web ADF - Web controls  

MapCopyrightText control



The MapCopyrightText control is designed to display copyright text on a Map control.  At runtime, the MapCopyrightText control is rendered as text that can be clicked on to display a callout dialog with comprehensive copyright (or other) information.   As a developer, you can define the clickable text and callout content.  All copyright text properties are rendered in a browser, thus any valid HTML content can be used. 

If the Map control contains ArcGIS Server map resources, copyright information (if present) for each layer will be appended to developer defined callout content.   Copyright information can be defined when authoring a map document (mxd) using ArcMap.   In ArcMap, open the layer properties dialog and select the General tab.  Add copyright information in the Credits textbox.  Note, no other data source types return copyright information.   

Assembly: ESRI.ArcGIS.ADF.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.UI.WebControls.MapCopyrightText

Using the MapCopyrightText control
  1. Add the controls to the page

    Open or create a Web site within Visual Studio.   Open a Web form in design mode, select the Toolbox, and expand the ArcGIS Web Controls tab.  Drag and drop a MapResourceManager, Map, and MapCopyrightText control onto the Web form.

    Add one or more resources to the MapResourceManager.  See the Add Resources section in the MapResourceManager control topic for information on how to do this. Also set the Map control's MapResourceManager property to Map1. See Map Control for information on setting this property. Your page should resemble the following in Visual Studio:



  2. Set MapCopyrightText control properties

    Select the MapCopyrightText control.  In the Properties page:
    1. Set the Map property to the Map control added earlier.
    2. Set the Text property to the clickable text you want the MapCopyrightControl to display at runtime.   
    3. Set the CalloutWindowTitleText property to the text you want to display in the header of the callout dialog when the MapCopyrightText control is clicked at runtime.  This text is always rendered bold. 
    4. Set the CopyrightText property to the text you want to display in the body off the callout dialog.  Note, if the Map contains an ArcGIS Server map resource with layers that have copyright information, it will be appended to the text you define for this property.  The map resource item name will also be added before any layer information.   
    5. Additional properties can be configured to change the scalebar appearance. These include:
      • BackColor: The default value is transparent.  If the copyright text is on top of the Map control, define a color that will make it easy to see the clickable copyright text.    
      • Font:  Use to define all copyright text properties. 
  3. Change the position of the control

    Change the positioning of the control to be absolute, which enables the control to be placed anywhere on the page.  By default, Visual Studio adds controls in flow layout.  Right-click the MapCopyrightText control and select "Style".    In the Style Builder dialog, select the Position option and click the dropdown list under "Position Mode".  Select "Absolutely position" and click OK to exit the dialog.  Select the MapCopyrightText control in design view and start to drag it to another location on the page.  In most cases, you will drag it over a Map control.  Note that when you first attempt to move the contrl, it will immediately display in the upper left corner of the page.  This is default behavior associated with Web control positioning in Visual Studio.  Select the MapCopyrightText control again and drag it to your desired location.


      
  4. Runtime use

    At runtime, click on the MapCopyrightText control to display the callout dialog with comprehensive copyright information.  In this example, the MapCopyrightText control was placed in the lower right corner of the Map.   The MapResourceManager used by the Map contained a single ArcGIS Server map resource item "MapResourceItem0" which contains four feature layers.  Two layers have copyright (credits) text defined.   The following property values have been defined on the MapCopyrightText control:
Members

Properties 

  The following table provides a list of properties of interest.  For complete reference information, see the MapCopyrightText control in the library reference section.

Property Name  Type Description
Map Map The Map control associated with copyrighted content (e.g. layers).
CalloutWindowTitleText string The text in the header of the callout dialog displayed at runtime when clicking on the MapCopyrightText control. 
CopyrightText string The text in the body of the callout dialog displayed at runtime when clicking on the MapCopyrightText control.
Text string The clickable text displayed by the MapCopyrightText control at runtime.