Introduction to MapLab

Open Source GIS Conference 2004

Ottawa, ON

June 9th, 2004

Zak James

Jeff McKenna

About the Presenters

Name: Zak James

Title: Software Developer

Company/Organization: DM Solutions Group

Contact Info:

Biography:

Zak James is an experienced software developer with an educational background in Geography and GIS. Prior to joining DM Solutions he worked on software modelling and non-linear mathematical optimization for both geospatial and computer-aided manufacturing applications. He is the product manager for Maplab and has extensive experience with OGC standards and their MapServer implementations.

Name: Jeff McKenna

Title: GIS Specialist

Company/Organization: DM Solutions Group

Contact Info:

Biography:

Jeff McKenna has been with DM Solutions since around the time they adopted MapServer for their web mapping needs. His educational background in GIS has provided him with a thorough understanding of the issues surrounding data management. He is a frequent contributor to the MapServer Documentation Project, including documents on OGR and WMS. Jeff is also a member of the Geographic and Cartographic Research Centre at Carleton University. What is MapLab?

MapLab is a suite of effective and intuitive web-based tools for creating and managing MapServer Web mapping applications and map files. It consists of three components: MapEdit, MapBrowser and GMapFactory.

Components of MapLab

MapEdit

A visual administration tool for the editing and management of map files. MapEdit gives you full control over all aspects of a map file and provides validation to ensure your map file structure is correct. It also features a form-based interface for modifying mapfile parameters, a fully navigable map preview, access to the raw mapfile, and symbol, colour, font, and file selector dialogs.

MapBrowser

A tool for the visual selection of spatial data from local and WMS sources. It can also be used to specify a key map view, map size and map projection. When used outside of MapLab, it can act as a stand-alone browser of WMS compliant servers.

GMapFactory

An intuitive tool for the rapid creation and deployment of mapping applications. GMapFactory can be used to define the layout of an application and specify which mapping interface components to include.

MS4W

·  MapServer/PHPMapscript 4.2

·  PHP 4.3.X

·  Apache Web Server

Objectives of MapLab Workshop

·  Editing a mapfile

·  Adding remote layers with MapBrowser

·  Generating a mapping application using GMapFactory

·  Hands-on demonstration of upcoming technologies

Step 1: Run MapLab

·  Open web browser

·  Type: http://localhost/ and hit <return>

·  Scroll down and click on “MapLab Workshop” in the OSGIS Workshops section

·  MapLab opening page should appear

·  Click on MapEdit

Step 2: Add a Layer in MapEdit

·  Click on the ‘preview map’ icon (in middle of toolbar with the glasses)

·  Map of Canada should appear in a new window

·  Close preview window

·  Make sure “Map (DEMO)” at top of the Object Browser is highlighed (active)

·  From the “Create New Object” pulldown click “Layer Object” and click the “Add new item” button (plus sign) to the right of the pulldown

·  A new empty layer should be added to the Object Browser

·  In the Object Properties frame fill in a name, a data source (“park”), and a datatype (polygon) and apply changes

·  The new layer is now populated with these properties

·  Make sure the new layer is active in the Object Properties frame, and select “Class Object” from the “Create New Object” pulldown and click the “Add new item” button

·  An empty class should be added to your layer

·  Give the class a name

·  From the the “Create New Object” pulldown click “Style Object” and click the “Add new item” button

·  Give it a colour and an outline colour (do not specify a name for the style)

·  Preview the map…should display a new parks layer with your specified style

·  Use the File Menu and select “Save Map As..” giving it a new name

Step 3: Add a Remote Layer in MapBrowser

·  Click on the MapBrowser icon in the top left toolbar (the one with the magnifying glass)

·  In the top toolbar, click on the “Manage Servers” icon (second from the right)

·  The “Manage Servers” dialog allows you to search remote servers, and add spatial data to your mapfile

·  In the “Server Properties” section of the dialog give the server a name (“MUM2”) and add the following URL:

o  http://dev1.dmsolutions.ca/cgi-bin/mswms_mum2?

Backup layers:

http://atlas.gc.ca:80/cgi-bin/atlaswms_en?

http://ceoware2.ccrs.nrcan.gc.ca/cubewerx/cubeserv/cubeserv.cgi?

·  Click “Add” and this server will be added to your list of available servers

·  Close the window, and this server should appear in the bottom left frame (“Data Stores”)

·  Use the tree menu to click down to the “Delegates” layer, and click on it to add it

·  This layer remote layer should now be included at the top of your layer list

·  Click Apply above the layer list to show it in the map

·  The map should now display the delegates WMS point layer

·  Save the map using the MapBrowser file menu

Step 4: Creating a Spatial Web Application

·  Click on the GmapFactory icon in the top left toolbar (the one with the purple gear)

·  Give your web project a name (no spaces allowed) and press OK

·  A default application layout appears in the right panel

·  You can use the left frame to change the appearance

·  GmapFactory uses the idea of columns for application elements, so you can customize the layout and appearance

·  When you are satisfied with how your application appears, click on the URL in the top right and you will see your completed stand-alone phpmapscript application

Upcoming Technologies

Studio

Studio is a Chameleon-based application for classifying WMS layers remotely. However, we have decided to enhance this technology to provide the basis of a new MapLab. It emphasizes quick feedback and ease of use, and will grow to become more capable than the current MapLab product. It will eventually incorporate broad OGC discovery and publishing components as well as more automated map editing.

This new version is under active development and we invite MapLab users to make comments on the user list in order to have their say on the final features.

Hands-on Preview

Steps:

·  Go back to http://localhost/ with your browser, and select “Studio Workshop”

·  The Studio interface should be launched

·  Click on “Open Context” and in the panel that appears use “Browse” to navigate to C:/ms4w/apps/studio/contexts and select “World2.xml”, click “Open” and then OK

·  You should now see a map of the world

·  Select the radio button for the “WorldGen” layer and click on the “Classify” icon (the one with the puzzle)

·  A classification window will appear

·  For “Attribute” at the top of the panel, if there is a picklist choose “NA3DESC”, but if there is only a textbox type it in

·  For “Label” at the top of the panel, if there is a picklist choose “NA3DESC”, but if there is only a textbox type it in

·  Choose “Polygon” for Feature Type

·  Click on the green plus icon to add a class

·  In “Expression” type in ‘Africa’

·  Click on “Symbolization”, and click on the green plus in the panel that appears to add a style

·  Select “Solid (square)” from the pattern picklist

·  Choose a colour with the colourpicker

·  Click “Apply” and a preview should appear in the left frame

·  Click the green plus sign again to add a second style

·  Click the “Stroke” radiobutton

·  Choose “Circle” for the symbol

·  Make its width 4

·  Choose a different colour, and hit Apply

·  The preview frame should update

·  Click OK to save your changes

·  Click Close to dismiss the dialog box

·  Notice that the symbolization preview has changed in the classes panel

·  Click on the “Label Style” preview and modify the font if you desire

·  Click Apply and then close the panel

·  Africa should appear with the style that you picked

For More Information and to Download Maplab …

·  http://www.maptools.org/ms4w/

·  http://www.maptools.org/maplab/