Using mapxtreme as a wms client – Pitney Bowes MapXtreme User Manual

Page 345

Advertising
background image

Chapter 19: Web Map Service

Understanding WMS Operations

MapXtreme v7.1

352

Developer Guide

GetMap

Once you know the capabilities of the WMS server, a GetMap request is issued to request a map
image of one or more of the WMS server’s map layers. Based on the WMS Server capabilities, a
GetMap request includes the following.

Version–Request version

Layers–one or more layers of map data

Styles–display styles for rendering the layers. If this is not specified, default styles will be used.

A bounding box–the area to be included in the map image in

CRS–for WMS 1.3.0, or SRS (WMS 1.1.1) the coordinate reference system for the map in the
form of namespace:identifier.

Output format–a MIME type such as GIF and PNG, for the output map image

Output size–height and width in pixels of the map image

Background color–a hexadecimal red-blue-green color value such as 0xFFFFFF (required when
transparency is true)

Transparency–a true/false setting that indicates if the layer can be used as a transparent overlay
to other layers.

GetFeatureInfo

Once a GetMap request has been successfully completed the user may want further information
about the features included in the map. The GetFeatureInfo operation returns information regarding
the layers in the map and the queryable attributes of each layer. This operation is controlled by the
WMS Server, however, the server may not offer this capability.

Using MapXtreme as a WMS Client

You can request a WMS map image programmatically using the MapXtreme WMS client via
MapInfo.Data.TableInfoWMS. This section provides code snippets that illustrate how to use
MapXtreme as a WMS client. In addition, a WMSPreview sample application is located in the
Desktop samples folder after installation.

GetCapabilities

In MapXtreme, you do not call GetCapabilities directly. Your request for a map is contained in a call
using an WMSClient that takes a capabilities instance as input.

// build the capabilities
ICapabilities capabilities = WmsClientUtilities.GetCapabilities

(url, "1.3.0");

// create the WMS client
WmsClient wmsClient = new WmsClient(capabilities);
wmsClient.AddLayer("WORLD");
wmsClient.Srs = "EPSG:4326";
wmsClient.BGColor = Color.Blue;
wmsClient.MimeType = "image/gif";

Advertising