Changes between Version 6 and Version 7 of FdoWmsNotes
- Timestamp:
- 02/14/08 16:12:12 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FdoWmsNotes
v6 v7 1 1 2 = Overriding WMS Settings for MapGuide Open Source Consumption = 3 4 Configuration of WMS feature sources within MapGuide Open Source is generally done using one of the commercial (such as Autodesk MapGuide Studio) or open source (such as Webstudio) GUI's. Unfortunately, these GUI's currently do not allow the overriding of configuration information used in the WMS requests. Examples of these configuration options include: 2 = Overriding WMS Settings for !MapGuide Open Source Consumption = 3 '''If you wish, you can download a PDF version of this document at the bottom of the page.''' 4 5 Configuration of WMS feature sources within !MapGuide Open Source is generally done using one of the commercial (such as Autodesk !MapGuide Studio) or open source (such as Webstudio) GUI's. Unfortunately, these GUI's currently do not allow the overriding of configuration information used in the WMS requests. Examples of these configuration options include: 5 6 6 7 * Image transparency … … 8 9 * Image background color 9 10 * Coordinate system 10 * Displaying of multiple WMS layers in a single MapGuide layer11 * Displaying of multiple WMS layers in a single !MapGuide layer 11 12 12 13 = Configuration Document = 13 14 14 This section describes how to create the configuration document for the MapGuide WMS feature source.15 This section describes how to create the configuration document for the !MapGuide WMS feature source. 15 16 16 17 == Get the Capabilities Document == 17 Before anything can be done, you should get the capabilities document for the WMS service. This document contains the list of all the layers and possible values that can be used for the configuration parameters. To do this: Start a web browser and go to the location http://<WMSServiceAddress>?service=wms&request= GetCapabilities18 Before anything can be done, you should get the capabilities document for the WMS service. This document contains the list of all the layers and possible values that can be used for the configuration parameters. To do this: Start a web browser and go to the location http://<WMSServiceAddress>?service=wms&request=!GetCapabilities 18 19 19 20 == Basic Configuration Document == … … 78 79 79 80 Substitute %!LayerName% with the name of the WMS layer that you want to display. For example, if the following entry occurs in WMS capabilities document: 80 <Layer queryable="1" opaque="0" noSubsets="0">81 <Name>theLayerName</Name>82 83 </Layer>81 <Layer queryable="1" opaque="0" noSubsets="0"> 82 <Name>theLayerName</Name>[[BR]] 83 <Title>The layer title</Title> 84 </Layer> 84 85 then substitute %!LayerName% with theLayerName. 85 86 86 87 At the end of the document are the following configuration parameters that can be adjusted as appropriate: 87 88 * Format – used to specify the image type. The possible values here are in the WMS capabilities document in the GetMap section. Do not include the “image/” part of the format here. That is, if the desired format is specified in the WMS capabilities document as “image/png”, put “png” in the configuration document. 88 * Transparent – if the WMS Service supports transparency then specifying true here will make the background of the returned image transparent. This transparency is preserved in MapGuide so any layers that this WMS layer is placed over will show through the transparent regions.89 * Transparent – if the WMS Service supports transparency then specifying true here will make the background of the returned image transparent. This transparency is preserved in !MapGuide so any layers that this WMS layer is placed over will show through the transparent regions. 89 90 * !BackgroundColor – if the WMS Service supports specifying background colors, set the RGB value (e.g., 0xFFFFFF=white, 0x000000=black, 0x0000FF=blue, 0xFF0000=red, 0x00FF00=green), here for the color. 90 91 * Time – time value of the desired WMS layers. … … 95 96 Once the substitutions have been made save the file. 96 97 97 == Multiple WMS Layers in a Single MapGuide Layer ==98 To get multiple WMS layers in a single MapGuide layer, it is enough to specify multiple Layer tags in the configuration document. When the resulting feature class (i.e., name substituted for %!FeatureClassName%) is specified in a layer, the layer will display all of the specified WMS layers. The following XML snippet shows how the multiple layers are specified:98 == Multiple WMS Layers in a Single !MapGuide Layer == 99 To get multiple WMS layers in a single !MapGuide layer, it is enough to specify multiple Layer tags in the configuration document. When the resulting feature class (i.e., name substituted for %!FeatureClassName%) is specified in a layer, the layer will display all of the specified WMS layers. The following XML snippet shows how the multiple layers are specified: 99 100 100 101 {{{ … … 123 124 124 125 == Specifying Multiple Feature Classes == 125 A WMS service typically serves multiple layers. Using the basic configuration document approach above it is a lot of work to expose the layers because one feature source per WMS layer would need to be created. The following describes how to specify more than one feature class per MapGuide WMS feature source; a feature class corresponds to a set of WMS layers that can be displayed in a single MapGuide layer. Note that for each feature class, multiple WMS layers could also be specified as described in the Multiple WMS Layers in a SingleMapGuide Layer section.126 A WMS service typically serves multiple layers. Using the basic configuration document approach above it is a lot of work to expose the layers because one feature source per WMS layer would need to be created. The following describes how to specify more than one feature class per !MapGuide WMS feature source; a feature class corresponds to a set of WMS layers that can be displayed in a single !MapGuide layer. Note that for each feature class, multiple WMS layers could also be specified as described in the Multiple WMS Layers in a Single !MapGuide Layer section. 126 127 127 128 Three sections need to be replicated in order to create another feature class. The replicated sections are in bold below. The sequence of the sections is important. … … 221 222 }}} 222 223 223 = Creating a MapGuide WMS Feature Source =224 This section describes how to create a MapGuide WMS feature source that will be associated with the configuration document.224 = Creating a !MapGuide WMS Feature Source = 225 This section describes how to create a !MapGuide WMS feature source that will be associated with the configuration document. 225 226 == Creating the Feature Source Document == 226 227 To create the feature source document, copy the follow XML to a text editor: … … 243 244 244 245 Save the file. 245 == Creating the Feature Source in MapGuide ==246 The next step is to upload the feature source document onto the MapGuide site. The steps to do this are as follows:247 1. Start a web browser and go to the location http://<machinename>/mapguide/mapagent/index.html, where machinename is the location in which MapGuide is installed.246 == Creating the Feature Source in !MapGuide == 247 The next step is to upload the feature source document onto the !MapGuide site. The steps to do this are as follows: 248 1. Start a web browser and go to the location http://<machinename>/mapguide/mapagent/index.html, where machinename is the location in which !MapGuide is installed. 248 249 2. Click on the SetResource link in the left frame. A SETRESOURCE form will appear in the right frame. 249 250 3. In the Resource ID field, type the name of the resource that you want to create. Make sure that the name ends with .FeatureSource. The resource name is case-sensitive. … … 251 252 5. Leave the Header field blank. 252 253 6. Click Submit on the SETRESOURCE form. 253 7. If you have not authenticated yet with the MapGuide site, a login dialog will appear. Enter the credentials of aMapGuide author or administrator user.254 7. If you have not authenticated yet with the !MapGuide site, a login dialog will appear. Enter the credentials of a !MapGuide author or administrator user. 254 255 255 256 After completing the steps above, a blank web page will take the place of the SETRESOURCE form. … … 257 258 = Attaching the Configuration Document = 258 259 This section describes how to attach the configuration document created above to the feature source. 259 1. Start a web browser and go to the location http://<machinename>/mapguide/mapagent/index.html, where machinename is the location in which MapGuide is installed. Figure 1 above shows how the web page should look.260 1. Start a web browser and go to the location http://<machinename>/mapguide/mapagent/index.html, where machinename is the location in which !MapGuide is installed. Figure 1 above shows how the web page should look. 260 261 2. Click on the SetResourceData link in the left frame. A SETRESOURCEDATA form will appear in the right frame. 261 262 3. In the Resource ID field, type the name of the resource to which you want to add the configuration document. This is the same feature source resource that you created above. The resource name is case sensitive. … … 264 265 6. For the Data field, browse to the location of the configuration document that you created above. 265 266 7. Click Submit on the SETRESOURCEDATA form. 266 8. If you have not authenticated yet with the MapGuide site, a login dialog will come up. Enter the credentials of aMapGuide author or administrator user.267 8. If you have not authenticated yet with the !MapGuide site, a login dialog will come up. Enter the credentials of a !MapGuide author or administrator user. 267 268 268 269 After completing the steps above, a blank web page will take the place of the SETRESOURCEDATA form.