MapCopyrightText control


In this topic


About the MapCopyrightText control

Use the MapCopyrightText control to show copyright text on a Map control. At runtime, the MapCopyrightText control is rendered as text that can be clicked. When the text is clicked, a callout with copyright (or other) information appears. All copyright text properties are rendered in a Web browser; therefore, any valid Hypertext Markup Language (HTML) content can be used. 
If the Map control contains ArcGIS Server map resources, copyright information (if available) for each layer is appended to defined callout content. Copyright information can be defined when authoring a map document (.mxd) using ArcMap. In ArcMap, open the layer's Properties dialog box and select the General tab. Type copyright information in the Credits text box. No other data source types return copyright information. 

Using the control

  1. To add controls to the page, open or create a Web site in Visual Studio. Open a Web form in design mode, select the Toolbox panel, and expand the ArcGIS Web Controls tab. Drag and drop a MapResourceManager, Map, and MapCopyrightText control on the Web form.
  2. Add one or more resources to the MapResourceManager. Set the Map control's MapResourceManager property to Map1. See the following screen shot showing MapResourceManager in Visual Studio:


  3. To set the MapCopyrightText control properties, select the MapCopyrightText control. Do the following on the Properties window:
    1. Set the Map property to the Map control previously added.
    2. Set the Text property to the text (that is clicked) you want the MapCopyrightControl to show at runtime.   
    3. Set the CalloutWindowTitleText property to the text you want to show in the header of the callout when the MapCopyrightText control is clicked at runtime. This text is always rendered as bold. 
    4. Set the CopyrightText property to the text you want to show in the body of the callout. If the map contains an ArcGIS Server map resource with layers that have copyright information, it is appended to the defined text for this property. The map resource item name is added before any layer information.   
    5. Additional properties can be configured to change the scale bar's appearance. These include the following:
      • BackColor—If the copyright text is on top of the Map control, define a color making it easier to view the copyright text that can be clicked. The default value is transparent. 
      • Font—Use to define all copyright text properties.
  4. Change the position of the control to be absolute, which enables the control to be placed anywhere on the page. By default, Visual Studio adds controls in a flow layout. Right-click the MapCopyrightText control and select Style. The Style Builder dialog box appears.
  5. On the Style Builder dialog box, click the Position option, then click the Position mode drop-down list. Select Absolutely position under the list and click OK. See the following screen shot showing the Style Builder dialog box:


  6. In design view, select the MapCopyrightText control and drag it to another location on the page, for example, drag it over a Map control. When you move the control, it appears 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 the applicable location.
  7. At runtime, click the MapCopyrightText control to show the callout that contains the copyright information. In this topic, 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 were defined on the MapCopyrightText control:
    • Map—Map1
    • Text—Copyright © ESRI 2008
    • CalloutWindowTitleText—ESRI Copyright Statement
    • CopyrightText—<br/>Copyright © ESRI 2008<br/>All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
    • BackColor—White

      See the following screen shot showing the copyright text in the callout:

Members

The following table shows a list of properties related to the MapCopyRightText control. For more reference information, see the MapCopyrightText control in the library reference section.
Property name
Type
Description
Map
map
Map control associated with copyrighted content, for example, layers.
CalloutWindowTitleText
string
Text in the header of the callout shown at runtime when the MapCopyrightText control is clicked.
CopyrightText
string
Text in the body of the callout shown at runtime when the MapCopyrightText control is clicked.
Text
string
Text to click that is shown by the MapCopyrightText control at runtime.


See Also:

Web ADF controls
Customizing the Web Mapping application




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
  • ESRI.ArcGIS.ADF.UI.WebControls.dll