Map colors in PHP/Mapscript 4

G-Net Consulting joelf at GNETCONSULTING.COM
Mon Sep 13 11:40:15 EDT 2004


Hello list:

Probably a simple mistake on my part, but I cannot get the proper
colors to display on my map.  I'm wondering what I'm doing wrong.
I assume the .map setup would be fine, or do I need to specify
this info programmatically in PHP?

I want the image to have a white background.  The map is the US
with Alaska, Hawaii, and Puerto Rico.  I want the states to be a
light brown, with the county and state boundaries black.

Currently, the state outlines are black, the counties are brown, and
everything else (all backgrounds) are white.  The sensors (last layer)
display fine.

Any help would be appreciated.  Thanks.

.MAP File
========================
MAP
  NAME "GMF"
  STATUS ON
  EXTENT -179.133392 17.674692 179.788208 71.398048
  SIZE 600 450
  SHAPEPATH "./data"
  SYMBOLSET "./etc/symbols.sym"
  FONTSET "./etc/fonts.txt"
  IMAGETYPE PNG
  IMAGECOLOR 255 255 255
  # UNITS METERS
  # SCALE 165582

  # include our web data
  WEB
    # MINSCALE 2000000
    # MAXSCALE 50000000
    IMAGEPATH "/tmp/ms_tmp/"
    IMAGEURL "/ms_tmp/"
  END

  # include our querymap data
  QUERYMAP
    STATUS ON
    COLOR 255 0 0
    STYLE HILITE
  END

  # add our legend
  LEGEND
    STATUS ON
    # IMAGECOLOR 255 255 255
    POSITION LL
    KEYSIZE 18 12
    KEYSPACING 5 5
    TEMPLATE "ttt"
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      OFFSET 0 0
      # OFFSET 0 BUFFER
      BUFFER 0
      MINDISTANCE -1
      MINFEATURESIZE -1
      COLOR 0 0 89
      PARTIALS TRUE
      FORCE FALSE
    END
  END

  # specify the format to save the image as
  OUTPUTFORMAT
    NAME "PNG"
    MIMETYPE "image/png"
    DRIVER "GD/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT OFF
  END

  OUTPUTFORMAT
    NAME imagemap
    MIMETYPE "text/html"
    DRIVER imagemap
  END

  # begin our counties layer
  LAYER
    NAME "counties"
    STATUS ON
    DATA "./counties"
 TYPE LINE
 CLASSITEM "COUNTY"
    SYMBOLSCALE 8
    LABELITEM "COUNTY"
    LABELCACHE ON
    POSTLABELCACHE TRUE
 TEMPLATE "counties.html"
    METADATA
      "DESCRIPTION"    "US Counties "
      "RESULT_FIELDS" "STATE"
    END
    CLASS
      NAME "Counties"
   STYLE
        SYMBOL 8
        COLOR 238 207 145
        OUTLINECOLOR 0 0 0
        BACKGROUNDCOLOR 238 207 145
        SIZE 1
        MINSIZE 1
        MAXSIZE 100
      END
    END
  END

  # begin our states layer
  LAYER
    NAME "states"
    STATUS ON
    DATA "./states"
    TYPE LINE
 CLASSITEM "STATE"
 FILTERITEM "STATE"
 SYMBOLSCALE 8
    LABELITEM "STATE"
    LABELCACHE ON
    POSTLABELCACHE TRUE
 TEMPLATE "states.html"
    METADATA
      "DESCRIPTION"    "US States "
      "RESULT_FIELDS" "STATE"
    END
    CLASS
      NAME "States"
   TEMPLATE "states.html"
   STYLE
        SYMBOL 8
        COLOR 0 0 0
        OUTLINECOLOR 0 0 0
        BACKGROUNDCOLOR 238 207 145
        SIZE 1
        MINSIZE 1
        MAXSIZE 100
      END
 END
  END

  # begin our sensors layer
  LAYER
    NAME "sensors"
    STATUS ON
    DATA "./sensors"
    TYPE POINT
 CLASSITEM "ID"
    SYMBOLSCALE 10
    LABELITEM "ID"
    LABELCACHE ON
    POSTLABELCACHE TRUE
 TEMPLATE "sensors.html"
    METADATA
      "DESCRIPTION" "GMF Sensors "
      "RESULT_FIELDS" "ID"
    END
    CLASS
      NAME "Sensors"
   TEMPLATE "sensors.html"
      STYLE
        SYMBOL 4
        COLOR 0 255 0
        OUTLINECOLOR 0 0 0
        SIZE 3
        MINSIZE 3
        MAXSIZE 5
      END
 END
  END
END



More information about the mapserver-users mailing list