Skip to content

Mapserver module api

Paul Spencer edited this page Jul 8, 2013 · 10 revisions

Module | Error | Map | Layer

Mapserver Module API

Defined Values

Most of the MS_XXXXX values are defined as constants through the mapserver module, for instance:

var mapserver = require('mapserver');
console.log('MS_ON value is ' + mapserver.MS_ON);

outputs

MS_ON value is 1

Module Methods

These methods are invoked directly on the module after it has been required.

getVersion

returns the version information for mapserver as a string value

Example:

require('mapserver').getVersion();

returns

MapServer version 5.6.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

getVersionInt

Returns the version number for mapserver as an integer value.

Example:

require('mapserver').getVersionInt();

returns

 50605

supportsThreads

Returns true if mapserver is built with threading support, false otherwise

Example:

console.log(require('mapserver').supportsThreads());

resetErrorList

Clears the error stack

Example:

require('mapserver').resetErrorList();

getError

Returns the next error in the mapserver error stack or undefined if there are no more errors.

require('mapserver').getError();