Skip to Content
Web Mapping Illustrated
book

Web Mapping Illustrated

by Tyler Mitchell
June 2005
Beginner to intermediate
372 pages
10h 1m
English
O'Reilly Media, Inc.
Content preview from Web Mapping Illustrated

MapScript Objects

For a complete MapScript object, variable, and method guide see the latest on the MapServer documentation web site page or Sean Gillies' reference guide (http://zcologia.com/mapserver).

Class diagrams are also available from these web sites:

Classes within the map file can be accessed as objects in MapScript. In fact, there are more objects to handle than you normally see, because MapServer does a lot of the work with them behind the scenes. The main part of a MapScript application is the map object (mapObj ). The mapObj can have many layer objects (layerObj ) as well as legend (legendObj ), scale bar (scalebarObj ), and reference map (referenceMapObj) objects. Figure 14-1 shows a diagram of how these objects are hierarchically structured.

The main object is the mapObj. You can add a layerObj, classObj , and styleObj to the mapObj. Other objects should never be explicitly created, such as webObj , scalebarObj, legendObj, and colorObj . These are already part of the mapObj, and constructing new objects for them will fail. If you get segmentation faults from MapScript, this may be the cause.

All the attributes of objects that you normally see in the map file are available for manipulation through MapScript.

Using the MapScript API is best understood by walking through some simple examples.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Flask Web Development, 2nd Edition

Flask Web Development, 2nd Edition

Miguel Grinberg

Publisher Resources

ISBN: 0596008651Supplemental ContentErrata Page