Opened 12 years ago

Closed 12 years ago

#154 closed defect (fixed)

Update "How To Add Your Own Layers"

Reported by: andersd Owned by: EliL
Priority: major Milestone: 2.6
Component: Docs Version: 2.6
Keywords: Cc:

Description

Add the following "useful tips" to the add your own layers section. This follows the format setup by Eli and should help new users to better understand how geomoose uses a mapserver file.

Tips and Advice


Using MapSever

GeoMoose fully utilizes MapServer mapfiles. The Mapserver files and data are located in the \maps directory in the demo. Extensive documentation regarding Mapserver is located at www.mapserver.org. A few important issues should be remembered when using MapServer MapServer from within the GeoMoose environment:

  1. GeoMoose 2.6 now uses MapServer only as a published WMS.

GeoMoose 2.6 is now configured to only consume Mapserver spatial maps as a WMS. This means your map file needs to contain the code to publish a WMS. At a minimum your map file should have the metadata code to name your service, identifiy the projection, and enable a request as illustrated in the following code taken from the parcel.map file in the demo.

WEB

METADATA

'ows_title' 'County'
'ows_srs' 'EPSG:26915 EPSG:4326 EPSG:900913 EPSG:3857'
'ows_enable_request' '*'

END

END

MapServer contains many other options for configuring the WMS which are dicussed in detail on the MapServer web site. As an added benefit the WMS which you have now produced can also be consumed by other applications that can consume a WMS.

  1. Usinging geomoose_globals.map file

GeoMoose map files typically reference the "geomoose_globals.map" file as included in the parcel.map file on the demo.

INCLUDE "../../geomoose_globals.map"

The "geomoose_globals.map" file is located in the maps directory and contains basic map parameters that GeoMoose relies on such as the calls to the symbol and fontset files as well as predefined output parameters. The demo has been setup based on relative paths to call the global file which in turn uses the relative path to call the fonset and symbol files. IT IS IMPORTANT THAT IF YOU CHANGE THE GENERAL PATH STRUCTURE THAT IS USED IN THE DEMO THAT YOU CHANGE THE RELATIVE PATH CALLS IN THE GEOMOOSE_GLOBALS FILE.

  1. Symbols and Fonts

Symbols and Fonts that are referenced by MapServer are stored in the maps/fonts and maps/symbols directory. Remember to check that any fonts or symbols you reference in a mapfile exist. MapServer has great documentation on changing symbols and fonts.

  1. Expanding map layer functionality

You can increase the functionality of your map layer to support queries, identify, selects and reports from within the mapfile as illustrated in the parcel.map file in the demo.

METADATA

# drill-down identify service record.

'identify_record' 'templates/identify.html'

# query.php / "Search Parcels" functionality.
'itemquery' 'templates/search_result.html'
'itemquery-filter' '/.*[qstring].*/i'
'qstring_validation_pattern' '.'


# Feature reports are stored in the conf/feature_report directory.
'feature_report' 'parcel.xml'

'select_record' 'templates/select_result.html'

'select_header' 'templates/select_header.html'
'popups' 'parcels_popup.html'

END

This functionality is discussed in more detail in other sections of the documentation.

Change History (2)

comment:1 by EliL, 12 years ago

Status: newtesting

comment:2 by andersd, 12 years ago

Resolution: fixed
Status: testingclosed
Note: See TracTickets for help on using tickets.