Reference Map Files

This section includes the complete listing of map files (Examples 12-13 through 12-16) used in this chapter. Additions to the files are highlighted. Lines to be removed are commented out by the preceding # symbols.

Example 12-13. The global_mosaic WMS layer added to the global.map file

MAP
  SIZE 600 300
  EXTENT -180 -90 180 90
  IMAGECOLOR 180 180 250
 IMAGETYPE PNG24

  UNITS DD

  WEB
    TEMPLATE global.html
    IMAGEPATH "/srv/www/htdocs/tmp/"
    IMAGEURL "/tmp/"
  END

  LAYER
    NAME global_landsat
    TYPE RASTER
    STATUS DEFAULT
    CONNECTIONTYPE WMS
    CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
    MINSCALE 20000
    METADATA
      "wms_server_version" "1.1.1"
      "wms_srs" "EPSG:4326"
      "wms_format" "image/jpeg"
      "wms_styles" ""
      "wms_name" "modis,global_mosaic"
    END
  END
  
  LAYER
    NAME countries
    TYPE POLYGON
    STATUS DEFAULT
    DATA countries_simpl
    LABELITEM 'NAME'
    LABELMAXSCALE 50000000  
    CLASSITEM 'NAME'
    CLASS
      NAME 'Bulgaria'
      EXPRESSION 'Bulgaria'
      STYLE
        OUTLINECOLOR 100 100 100
#     
               COLOR 255 255 150
      END
      LABEL
        SIZE LARGE
      END
    END
    CLASS
      NAME 'All Countries'
      EXPRESSION ('[NAME]' ne 'Bulgaria')
      STYLE
        OUTLINECOLOR 100 100 100
#        
               COLOR 200 200 200
      END
    END
  END
END

Example 12-14. Enabling a map file to serve up a layer using WMS

MAP
  SIZE 600 300
  EXTENT -180 -90 180 90
  IMAGECOLOR 180 180 250

  IMAGETYPE PNG24
  UNITS DD

  WEB
    TEMPLATE global.html
    IMAGEPATH "/srv/www/htdocs/tmp/"
    IMAGEURL "/tmp/"
    METADATA
      "wms_title" "My Global Map WMS Server"
      "wms_srs" "EPSG:4326"
    END
  END

  LAYER
    NAME countries
    TYPE POLYGON
    STATUS ON
    DATA countries_simpl
    MINSCALE ...

Get Web Mapping Illustrated now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.