wiki:ApplicationDefinition/MapSet/MapGroup

Version 2 (modified by pagameba, 17 years ago) ( diff )

--

Documentation | ApplicationDefinition | MapSet

MapGroup

A sub-tag of the MapSet tag, a MapGroup contains sub-tags for map rendering sources that are to be included in a visible map. A MapGroup must contain at least one Map tag to be valid. For example:

<MapGroup id="Parks" xsi:type="MapType">
  <Map xsi:type="MapGuideLayerType">
    <Type>MapGuide</Type>
    <SingleTile>true</SingleTile>
    <Extension>
      <ResourceId>Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition</ResourceId>
    </Extension>
  </Map>
</MapGroup>

The Map tag contains the following sub-tags:

Type:

The type of the map can be one of MapGuide or MapServer at this time. Future versions will support all the OpenLayers Layer types for this value.

SingleTile:

This contains a string value of either true or false to indicate if the map is composed of tiles (false) or a single image (true).

Extension:

The Extension tag contains sub-tags that are not defined by the schema. The content of the sub-tags depends partly on the Type of map specified.

General Extension

The generally supported Extension tags are supported by all or most of the map types. These are described below.

The Links tag allows you to specify metadata URLs to be associated with groups and layers. The Legend widget can use this metadata to add links into the rendered legend tree to hyperlink users to additional information about groups and layers.

The Links tag may contain the following sub tags:

  • Group - may occur any number of times. This specifies a group that is to have a metadata link. It has the following sub-tags:
    • Name - occurs once. This is a string value that is the name of the group. If a group of this name doesn't exist, the whole entry is ignored.
    • Url - occurs once. This is a string value that specifies the URL of a page to display for the group.
  • Layer - may occur any number of times. This specifies a layer that is to have a metadata link. It has the following sub-tags:
    • Name - occurs once. This is a string value that is the name of the layer. If a layer of this name doesn't exist, the whole entry is ignored.
    • Url - occurs once. This is a string value that specifies the URL of a page to display for the layer.

Example:

<Links>
  <Group>
    <Name>Roads</Name>
    <Url>http://myserver/groupinfo/roads.html</Url>
  </Group>
  <Layer>
    <Name>Parcels</Name>
    <Url>http://myserver/layerinfo/parcels.html</Url>
  </Layer>
</Links>

MapEvents

The MapEvents tag allows you to specify actions to take when layers and groups are turned on or off by a user. Valid actions are to turn on or off other layers and groups.

The MapEvents tag may contain the following sub-tags:

  • Layer - may occur any number of times. Specifies events associated with a specific layer.
    • Name - the name of the layer that the events are associated with.
    • OnEnable - the events to trigger when the user turns the layer on, see below.
    • OnDisable - the events to trigger when the user turns the layer off, see below.
  • Group - may occur any number of times. Specifies events associated with a specific group.
    • Name - the name of the group that the events are associated with.
    • OnEnable - the events to trigger when the user turns the group on, see below.
    • OnDisable - the events to trigger when the user turns the group off, see below.

The OnEnable and OnDisable tags contain the following sub-tags defining the event that are triggered:

  • Layer - may occur any number times. Specifies a layer that is affected as a result of an event.
    • Name - a string value, the name of the layer to affect.
    • Enable - a string value, true or false. If true, the layer is turned on, otherwise it is turned off.
  • Group - may occur any number times. Specifies a group that is affected as a result of an event.
    • Name - a string value, the name of the group to affect.
    • Enable - a string value, true or false. If true, the group is turned on, otherwise it is turned off.

Example:

<MapEvents>
  <Layer>
    <Name>Road</Name>
    <OnEnable>
      <Layer>
        <Name>Road Labels</Name>
        <Enable>true</Enable>
      </Layer>
      <Group>
        <Name>Road Decorations</Name>
        <Enable>true</Enable>
      </Group>
    </OnEnable>
    <OnDisable>
      <Layer>
        <Name>Road Labels</Name>
        <Enable>false</Enable>
      </Layer>
      <Group>
        <Name>Road Decorations</Name>
        <Enable>false</Enable>
      </Group>
    </OnDisable>
  </Layer>
  <Group>
    <Name>Amusements</Name>
    <OnEnable>
      <Layer>
        <Name>Road</Name>
        <Enable>true</Enable>
      </Layer>
      <Group>
        <Name>Parks</Name>
        <Enable>true</Enable>
      </Group>
    </OnEnable>
    <OnDisable>
      <Layer>
        <Name>Road</Name>
        <Enable>false</Enable>
      </Layer>
      <Group>
        <Name>Parks</Name>
        <Enable>false</Enable>
      </Group>
    </OnDisable>
  </Group>
</MapEvents>

MapGuide Extension

If you have defined a MapGuide map type, you must provide a <ResourceId> sub-tag that defines the repository path to the MapDefinition to be used to render this map.

MapServer Extension

If you have defined a MapServer map type, you must provide a <MapFile> sub-tag that defines the path to the MAP file to be used to render this map.

Note: See TracWiki for help on using the wiki.