docs:gis:mapserver:static_cgi_usage

Static CGI Usage for Mapserver

Just create a .map file as usual, and insert an image into your html document like this:

<img src="/cgi-bin/mapserv?mode=map&map=/gis/maps/example.map&layers=all&program=/cgi-bin/mapserv" width="640" height="480" />
modemap mode tells mapserver to generate and return a static image
mapthe location of the map file
layersshow all layers, type the layers you want, or you can use multiple layer=<layername> statements
programthis should be the same as the location for the running mapserv executable

* NOTE - if you specify a width and height, the image will be distorted if it isn't consistent with what you have for the size in the map file. You can leave it out of your html code, and mapserver will base the output size on what you have in the map file. If your map file SIZE property isn't consistent with the ratio of the extents, then mapserver will keep a proper aspect ratio and just not honor your extents exactly.

  • docs/gis/mapserver/static_cgi_usage.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1