PhpMapScript vs MapFile

Jacob Delfos jacob.delfos at MAUNSELL.COM
Tue Jun 14 03:35:05 EDT 2005


Bino,

Yes, but it's quite a pain to define the styles and classes, as I found out today......

This is the approach using (for point files), which seems to work:

$datasetlayer = ms_newLayerObj( $oMap );
$datasetlayer->set( "name", "dataset" );
$datasetlayer->set( "type", $oLayer->type);
$datasetlayer->set( "status", MS_ON );
$datasetlayer->set( "data", "datasetShapefile");
$datasetlayer->set( "template", "ttt" );
$datasetlayer->set( "tolerance", 5 );
$datasetlayer->set( "toleranceunits", MS_PIXELS);
$datasetlayer->setProjection($mapprojection);
$queryclass = ms_newClassObj($datasetlayer);
$queryclass->set("name", "Query result"); 
$queryclass->set("status", MS_ON);
$style = ms_newStyleObj($queryclass);

$symbolid = ms_newSymbolObj($oMap, "circle");
$oSymbol = $oMap->getsymbolobjectbyid($symbolid);
$oSymbol->setpoints(Array(1,1));
$oSymbol->set("filled",MS_TRUE);
$oSymbol->set("inmapfile", MS_TRUE);

$style->color->setRGB(255, 255, 0);
$style->set("symbolname", "circle");
$style->set("size", "8");

You should be able to figure it out based on the docs:
http://www.maptools.org/php_mapscript/index.phtml?page=php_mapscript_docs44.txt

regards,

Jacob


--------------------------------------------------------------------------------
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of bino_oetomo
Sent: 14 June 2005 15:23
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] PhpMapScript vs MapFile


Hi All .

Is it true that we can define layer in PHPMapScript so we don't need layer definition in the MapFile ?
If so , kindly please give me url that have example on how to do complette Layer definition (inc all the classes) in PhpMapscript.

Regards
-bino-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050614/f406724e/attachment.html


More information about the mapserver-users mailing list