CWC2 Service Instance - version 2.0

Abstract

This document describes the CWC2 Service Instance as implemented for Chameleon 2.0, as well as how to use it with your Chameleon application.

Last Updated: 2005/01/11

Revision History


Table of Contents

Introduction
What is the CWC2 Service Instance?
Set Up and Installation
Configuration File Changes
Installing the CWC2 Service Instance
System Configuration
Service Instance Configuration
Testing the Service Instance
Getting Further Help
Users Guide
Getting Started
Supported REQUESTs
Common Problems
Limitations
Further Example Service Instance URLS:
For More Information
About this Document
Revision History
Copyright/Licensing Information
Feedback

This document is intended to help install the CWC2 Service Instance for Chameleon 2.0, configure it, and help you use it. If, after thoroughly reading this document and trying out its instructions, you have further Service Instance questions, please refer to the For More Information section.

The CWC2 Service Instance is part of the Chameleon 2.0 package available from http://www.maptools.org. Please visit the Chameleon Web site at http://www.maptools.org/chameleon to access information about using Bugzilla (to report bugs) and the Chameleon users mailing list (to ask questions).

Please refer to the Set Up and Installation section for instructions on getting your Service Instance installed and tested. This section assumes that you have a fully functional and correctly configured Service Instance.

The CWC2 Service Instance supports two REQUESTs, described below.

The purpose of the GetApplication operation is to generate a client application based on the parameters provided when invoking the service.

Request Parameters

The GetApplication operation has three mandatory parameters and six optional parameters, which are described in the following table:

Please see the Common Invocation Parameters section above for details on the required parameters.

LANGUAGES

A list of language specifiers separated by commas. Languages are specified in the form of a two-character (lowercase) language code followed by a dash and then a two-character (uppercase) country code (e.g., en-CA). Service Instances list supported languages in the capabilities document. Unsupported languages may be requested, but the Service Instance uses the default language in these case. In addition, if the LANGUAGE parameter is not set, the default language (set in the Service Instance configuration file) is used.

This parameter is optional unless TEMPLATES parameter is set, in which case it becomes mandatory.

TEMPLATES

A list of application template paths or URLs separated by commas. A template is identified either by a relative (to the template root directory specified in the Service Instance configuration) path on the server or by a URL to a Web-accessible template. The templates are listed in the same order as their related language specifiers in the LANGUAGES parameter, with one template required for each supported language (even if the same template supports every language). URLs must be in the standard http://{server}/path/template.html format and must be URL-encoded.

Example URL

The following URL could be used to support a bilingual application using remote context files:

http://localhost/chameleon/cwc2/cwc2.php?
    service=VCG
    &version=0.1.0
    &request=GetApplication
    &LANGUAGES=en-CA,fr-CA
    &TEMPLATES=http://localhost/chameleon/cwc2/templates/sample_cwc2_en.html,
          http://localhost/chameleon/cwc2/templates/sample_cwc2_fr.html
        

This parameter is optional unless LANGUAGES is set, in which case it becomes mandatory. The Service Instance defines a default template in its configuration file.

CONTEXTS

A list of Web map context paths or URLs separated by commas. A context is identified either by a relative (to a directory specified in the Service Instance configuration) path on the server or a URL to a Web-accessible context. The contexts are loaded in the order in which they appear in this list, and the projection and spatial extents are taken from the last context loaded (see Common Problems below). The order of these contexts determines the order in which the layers of each context are drawn. Layers from the first context in the list are drawn first, layers from later contexts are drawn 'on top' of earlier ones. URLs must be in the standard http://{server}/path/template.html format and must be URL-encoded.

Example URL

The following URL could be used to get multiple remote contexts while using the default template and language:

http://localhost/chameleon/cwc2/cwc2.php?
    service=VCG
    &version=0.1.0
    &request=GetApplication
    &LANGUAGES=en-CA,fr-CA
    &TEMPLATES=http://localhost/chameleon/cwc2/templates/sample_cwc2_en.html,
          http://localhost/chameleon/cwc2/templates/sample_cwc2_fr.html
        

This parameter is optional. The Service Instance defines a default value context in its configuration file.

LANGUAGE

The language to use to display the application. This causes one of the templates to be selected from those specified as available in the TEMPLATES parameter. Typically, this parameter only needs to be used when a non-default language is being requested.

This parameter is optional. The Service Instance defines a default value in its configuration file.

BBOX

The BBOX provides a mechanism to define a different set of initial spatial extents than the default. By default, the Service Instance uses the extents defined in the last context opened. This may not be appropriate in all cases, especially when providing multiple contexts. The format for this parameter is a comma-separated list of values in the following order:

BBOX={MINX},{MINY},{MAXX},{MAXY}
        

The values are specified in georeferenced coordinates and depend on the spatial reference system of the initial view.

SRS

The SRS provides a mechanism to define a different spatial reference system than the default. By default, the Service Instance uses the SRS defined in the last context opened. This may not be appropriate in all cases, especially when providing multiple contexts. This parameter must use EPSG codes in the following format:

SRS=EPSG:XXXXX
        

Example URL

The following URL could be used to get a fully remote, bilingual application using multiple contexts, and defining an SRS and BBOX:

http://localhost/chameleon/cwc2/cwc2.php?
    service=VCG
    &version=0.1.0
    &request=GetApplication
    &LANGUAGES=en-CA,fr-CA
    &TEMPLATES=http://localhost/chameleon/cwc2/templates/sample_cwc2_en.html,
          http://localhost/chameleon/cwc2/templates/sample_cwc2_fr.html
    &SRS=epsg:4326
    &BBOX=-180,-90,180,90
    &CONTEXTS=http://localhost/chameleon/cwc2/contexts/world_context.xml,
          http://localhost/chameleon/cwc2/contexts/gmap_context.xml
      

Other useful sample Service Instance URLs include:

If you were unable to answer all the questions you had about the subject of this document, other possible methods of obtaining information include:

The numbering is in parallel with the revision control system. Missing numbers indicate minor maintenance revision updates.

Revision History
Revision 1.002004/08/20Paul Spencer
original text-only version
Revision 1.012004/08/21Darren Redfern
initial compilation in DocBook
Revision 1.12004/11/12Darren Redfern
finished initial draft
Revision 1.22004/11/13Darren Redfern
changes based on review comments
Revision 1.32004/12/08Chris Thorne
changed coding format, etc.
Revision 1.42004/12/08Darren Redfern
editorial changes
Revision 1.52005/01/11Jeff McKenna
minor changes, fixed docbook formatting errors