# OpenVAS
# $Id$
# Description: mapfile to render IPs with threat data on a world map.
#
# Authors:
# Raimund Renkert <raimund.renkert@greenbone.net>
#
# Copyright:
# Copyright (C) 2010 Greenbone Networks GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

MAP
  IMAGETYPE      PNG
  EXTENT         -180 -90 180 90
  SIZE           2000 1000
  UNITS DD
  SHAPEPATH      "."
  FONTSET        "__RWD__/fonts.txt"

# Output format is PNG
  OUTPUTFORMAT
    NAME "AGG"
    DRIVER "AGG/PNG"
    IMAGEMODE RGB
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_DITHER=OFF"
    FORMATOPTION "QUANTIZE_COLORS=256"
  END

#Symbol for host location
  SYMBOL
    NAME 'point'
    TYPE ELLIPSE
    POINTS
      1 1
    END
    FILLED TRUE
  END

# Start of LAYER DEFINITIONS
  LAYER # Map
    NAME         "map_picture"
    DATA         "__RWD__/world_map.tiff"
    STATUS       DEFAULT
    TYPE         RASTER
  END


  LAYER # IPs high
    NAME         "IPs_high"
    STATUS       DEFAULT
    TYPE         POINT
    PROJECTION
      "init=epsg:4326"
    END
    DATA         "ip_layer.shp"
    FILTER "red"
    FILTERITEM "color"

    CLASS
      NAME "IP_medium"
      MINSIZE 15
      MAXSIZE 15
      TEXT         ([IP]# [high] | [medium] | [low])
      LABEL
        WRAP "#"
        BACKGROUNDCOLOR 255 0 0
        BACKGROUNDSHADOWCOLOR 0 0 0
        TYPE TRUETYPE
        FONT "FreeSans"
        COLOR  0 0 0
        SIZE 14
        POSITION AUTO
      END
      STYLE
        SYMBOL 'point'
        SIZE 10
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
      END
    END
  END

  LAYER # IPs medium
    NAME         "IPs_medium"
    STATUS       DEFAULT
    TYPE         POINT
    PROJECTION
      "init=epsg:4326"
    END
    DATA         "ip_layer.shp"
    FILTER "orange"
    FILTERITEM "color"

    CLASS
      NAME "IP_medium"
      MINSIZE 15
      MAXSIZE 15
      TEXT         ([IP]# [high] | [medium] | [low])
      LABEL
        BACKGROUNDCOLOR 255 150 0
        BACKGROUNDSHADOWCOLOR 0 0 0
        WRAP "#"
        TYPE TRUETYPE
        FONT "FreeSans"
        COLOR  0 0 0
        SIZE 14
        POSITION AUTO
      END
      STYLE
        SYMBOL 'point'
        SIZE 10
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
      END
    END
  END

  LAYER # IPs low
    NAME         "IPs_low"
    STATUS       DEFAULT
    TYPE         POINT
    PROJECTION
      "init=epsg:4326"
    END
    DATA         "ip_layer.shp"
    FILTER "blue"
    FILTERITEM "color"
    CLASS
      NAME "IP_low"
      MINSIZE 15
      MAXSIZE 15
      TEXT         ([IP]# [high] | [medium] | [low])

      LABEL
        BACKGROUNDCOLOR 0 150 255
        BACKGROUNDSHADOWCOLOR 0 0 0
        WRAP "#"
        TYPE TRUETYPE
        FONT "FreeSans"
        COLOR  0 0 0
        SIZE 14
        POSITION AUTO
      END
      STYLE
        SYMBOL 'point'
        SIZE 10
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
      END
    END
  END

  LAYER # IPs other
    NAME         "IPs_other"
    STATUS       DEFAULT
    TYPE         POINT
    PROJECTION
      "init=epsg:4326"
    END
    DATA         "ip_layer.shp"
    FILTER "white"
    FILTERITEM "color"

    CLASS
      NAME "IP_other"
      MINSIZE 15
      MAXSIZE 15
      TEXT         ([IP])

      LABEL
        BACKGROUNDCOLOR 50 255 50
        BACKGROUNDSHADOWCOLOR 0 0 0
        TYPE TRUETYPE
        FONT "FreeSans"
        COLOR  0 0 0
        SIZE 14
        POSITION AUTO
      END
      STYLE
        SYMBOL 'point'
        SIZE 10
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
      END
    END
  END
  INCLUDE "non-georeferenced.map"
END
