wiki:ApplicationDefinition/MapSet/MapGroup

Version 7 (modified by jbirch, 14 years ago) ( diff )

Um, let's use a more reasonable scale value...

Documentation | ApplicationDefinition | MapSet

MapGroup

A child of the MapSet tag, a MapGroup contains configuration information 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, and may contain one InitialView tag. For example:

<MapGroup id="Sheboygan" xsi:type="MapType">
  <Map xsi:type="MapGuideLayerType">
    <Type>MapGuide</Type>
    <SingleTile>true</SingleTile>
    <Extension>
      <ResourceId>Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition</ResourceId>
    </Extension>
  </Map>
  <InitialView>
    <CenterX>430379</CenterX>
    <CenterY>5446616</CenterY>
    <Scale>50000</Scale>
  </InitialView>
</MapGroup>

Map

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 Extensions

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.

InitialView

InitialView allows you to set a zoom extents that is different that the maximum extents of the default map. This is useful for regional mapping, as it allows you to create a map with large extents to give a reasonable amout of context, but still have only your area of interest displayed on initial load.

There are two syntaxes allowed for InitialView, center and scale style, or bounding box style. The center and scale style is given precedence over the bounding box style if both sets of required tags exist. If any of the required tags are missing for either of these styles (for instance, omitting the CenterX tag for the center and scale style) that style will not be applied.

Center and Scale

This allows you to set the initial view based on a midpoint and a desired scale.

For this to be used, you must include valid CenterX, CenterY and Scale tags.

Example:

  <InitialView>
    <CenterX>430379</CenterX>
    <CenterY>5446616</CenterY>
    <Scale>50000</Scale>
  </InitialView>

Bounding Box

This allows you to set the initial view based on a desired bounding box.

For this to be used, you must include valid MinX, MinY, MaxX, and MaxY tags.

Example:

  <InitialView>
    <MinX>430379</MinX>
    <MinY>5446616</MinY>
    <MaxX>430541</MaxX>
    <MaxY>5446915</MaxY>
  </InitialView>
Note: See TracWiki for help on using the wiki.