Gulf of Maine Mapping Portal - GoMMaP
 

Building a Mapping Application Leveraging GoMMaP

Introduction

One of the services offered by the GoMMaP Portal is a mapping application development service. This service allows you to quickly and easily incorporate the type of interactive web mapping application you see in this portal into your own website..

GoMMaP makes this possible by offering an implementation of the Chameleon Service Instance that allows you to host your application on your server and leverage the GoMMaP service to process your web application and draw your map. You can get more information about the open source Chameleon technology at http://www.maptools.org/chameleon/.

Creating your own application involves setting up an application template, which is an HTML document with specialized mapping tags, and creating a map (or "map context") through the GoMMaP Portal. The two resulting documents can be maintained on any internet-accessible directory on your own server without any other specialized software required.

Overview of Chameleon Web Service

For a description of the Chameleon web service that you can leverage, please see the Chameleon Service Primer.

Creating Your Own Template

The first requirement for your mapping application is a 'template'. A template refers to an HTML file that contains special tags that GoMMaP's Chameleon service instance can understand. To obtain a sample template for starting reference please download the sample files here.

Extract the "gommap_sample.zip" file to a web-accessible directory. A directory named "gommap_sample" is created containing a few files, including:

  • sample_template.html -- working template file
  • sample_context.xml -- working context file

The sample template contains basic mapping functionality such as zooming in, zooming out, zooming to the full map extents, and querying. To view the sample template, enter the following URL into your web browser, and modify the TEMPLATE and CONTEXT paths to your local web-accessible location of the sample files:

http://www.gommap.org/cwc2/cwc2.php?service=VCG&request=GetApplication
&version=0.1.0&LANGUAGES=en-CA&TEMPLATES=http://path/to/your/sample_template.html
&CONTEXTS=http://path/to/your/sample_context.xml
                 

If you would like to modify the template please see the following docs:

Creating Your Own Map Context

The second requirement for your mapping application is a map "context" file. A context is basically a map composition, meaning that it is a mapping file that describes how your map appears (where the data comes from, what mapping extents your map view is, etc.). The file is actually an XML document. If you entered the above URL and modified the appropriate paths in the URL you would see a map of the Gulf of Maine area, which is specified in the "sample_context.xml" file.

To make it easy for you to create your own map context file (or map composition), and not have to modify the XML file directly, you can use the Map Builder application. The Map Builder application allows you to do the following:

  • open existing map context files - by using the Open button on the right of the application, and then choosing from the Map Context List
  • upload your own map context - by using the Open button, and then choosing Upload Map Context
  • add layers from remote servers - by using the Add New Layer button (green plus sign), and selecting from a pre-set list of remote servers, or adding your own servers, and then adding the layers to your map.
  • search for layers from remote servers - by using the Add New Layer button (green plus sign), and entering your search terms and pressing the SEARCH button, and then adding the layers to your map.
  • modify the layer order in your map (e.g. move roads layer above a water layer) - by making the appropriate layer active in the legend to the right of the map, and then using the blue arrow buttons above the legend to move the layer up or down.
  • zoom into a specific area - by using the zoom in, zoom out, and pan buttons above the map.
  • remove layers from your map context - by using the red X button above the legend.
  • save a map context locally - by using the Save button on the right of the application.

Viewing Your Custom Application

Once you have a map context file that you are satisfied with (using the Map Builder application) and a template that contains the functionality that you desire, you can load your new application by using the following URL and modifying the appropriate TEMPLATE and CONTEXT paths as before:

http://www.gommap.org/cwc2/cwc2.php?service=VCG&request=GetApplication
&version=0.1.0&LANGUAGES=en-CA&TEMPLATES=http://path/to/your_template.html
&CONTEXTS=http://path/to/your_context.xml
                 

You should now have a live mapping application that appears like this.

Notifying GoMMaP of New Public Application

If you have a live mapping application that leverages the GoMMaP Application service or any Gulf of Maine data through Open GIS Consortium specifications, we want to know about it. Contact us at info@gomoos.org and we'll add a reference to your application on the GoMMaP portal.