Guest User

Untitled

a guest
Jul 19th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None | 0 0
  1. define( "MAPFILE", "C:/gis/apps/osm/temp.map" );
  2. define( "MODULE", "php_mapscript.dll" );
  3. // load the mapscript module
  4. if (!extension_loaded("MapScript")) dl(MODULE);
  5. // open map
  6. $oMap = ms_newMapObj( MAPFILE );
  7. //force all errors to display
  8. //  comment out the next 2 lines, useful on servers not displaying errors
  9. ini_set('display_errors','On');
  10. error_reporting(E_ALL);
  11.  
  12. // set projection if necessary
  13. $oMap->setProjection("init=epsg:3857");
  14. $oMap->setsize(800, 600);
  15. $oMap->set("units",MS_DD);
  16. $oMap->selectoutputformat("png");
  17. $oMap->setFontSet("fonts.lst");
  18. $oMap->setExtent(-180,-90,180,90);
  19. $oMap->setMetaData("ows_enable_request","*");
  20. $oMap->setMetaData("ows_title","MAP_NAME");
  21. $oMap->web->set("imageurl","/output/");
  22. $oMap->web->set("imagepath", "/var/www/html/output/");
  23. // Setup the Geometry Layer
  24. /*$oLayerLand = ms_newLayerObj($oMap);
  25. $oLayerLand->set("name", "land");
  26. $oLayerLand->set("status", MS_ON);
  27. $oLayerLand->set("type", MS_LAYER_POLYGON);
  28. $oLayerLand->set("type", MS_LAYER_POINT);
  29. $oLayerLand->set("type", MS_LAYER_LINE);
  30. $oLayerLand->set("data", "north_america");
  31. $oLayerLand->set("classitem", "type");
  32. $oLayerLand->set("maxscaledenom", 1000000);
  33. $oLayerLand->set("minscaledenom", 0);
  34. $oLayerLand->set("group", "land");
  35. $oLayerLand->set("connection", "land");
  36. $oLayerLand->setconnectiontype(MS_POSTGIS);
  37. $oLayerLand->setprojection("init=epsg:3857");
  38. $oLayerLand->set("labelitem","name");
  39. $oLayerLand->setprocessing("LABEL_NO_CLIP=ON");
  40. $oLayerLand->setprocessing("CLOSE_CONNECTION=DEFER");
  41. $oLayerLand->setprocessing("APPROXIMATION_SCALE=full");
  42.  
  43.  
  44. $nSymbolId = ms_newSymbolObj($oMap, "circle");
  45. $oSymbol = $oMap->getsymbolobjectbyid($nSymbolId);
  46. $oSymbol->set("type", MS_SYMBOL_ELLIPSE);
  47. $oSymbol->set("filled", MS_TRUE);
  48. $aPoints[0] = 1;
  49. $aPoints[1] = 1;
  50. $oSymbol->setpoints($aPoints);
  51. $oMap->save("test1.map");
Advertisement
Add Comment
Please, Sign In to add comment