Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define( "MAPFILE", "C:/gis/apps/osm/temp.map" );
- define( "MODULE", "php_mapscript.dll" );
- // load the mapscript module
- if (!extension_loaded("MapScript")) dl(MODULE);
- // open map
- $oMap = ms_newMapObj( MAPFILE );
- //force all errors to display
- // comment out the next 2 lines, useful on servers not displaying errors
- ini_set('display_errors','On');
- error_reporting(E_ALL);
- // set projection if necessary
- $oMap->setProjection("init=epsg:3857");
- $oMap->setsize(800, 600);
- $oMap->set("units",MS_DD);
- $oMap->selectoutputformat("png");
- $oMap->setFontSet("fonts.lst");
- $oMap->setExtent(-180,-90,180,90);
- $oMap->setMetaData("ows_enable_request","*");
- $oMap->setMetaData("ows_title","MAP_NAME");
- $oMap->web->set("imageurl","/output/");
- $oMap->web->set("imagepath", "/var/www/html/output/");
- // Setup the Geometry Layer
- /*$oLayerLand = ms_newLayerObj($oMap);
- $oLayerLand->set("name", "land");
- $oLayerLand->set("status", MS_ON);
- $oLayerLand->set("type", MS_LAYER_POLYGON);
- $oLayerLand->set("type", MS_LAYER_POINT);
- $oLayerLand->set("type", MS_LAYER_LINE);
- $oLayerLand->set("data", "north_america");
- $oLayerLand->set("classitem", "type");
- $oLayerLand->set("maxscaledenom", 1000000);
- $oLayerLand->set("minscaledenom", 0);
- $oLayerLand->set("group", "land");
- $oLayerLand->set("connection", "land");
- $oLayerLand->setconnectiontype(MS_POSTGIS);
- $oLayerLand->setprojection("init=epsg:3857");
- $oLayerLand->set("labelitem","name");
- $oLayerLand->setprocessing("LABEL_NO_CLIP=ON");
- $oLayerLand->setprocessing("CLOSE_CONNECTION=DEFER");
- $oLayerLand->setprocessing("APPROXIMATION_SCALE=full");
- $nSymbolId = ms_newSymbolObj($oMap, "circle");
- $oSymbol = $oMap->getsymbolobjectbyid($nSymbolId);
- $oSymbol->set("type", MS_SYMBOL_ELLIPSE);
- $oSymbol->set("filled", MS_TRUE);
- $aPoints[0] = 1;
- $aPoints[1] = 1;
- $oSymbol->setpoints($aPoints);
- $oMap->save("test1.map");
Advertisement
Add Comment
Please, Sign In to add comment