Re: [mapserver-users] Drawing a simple filled polygon with PHP/mapscript

2009-03-11 Thread Pietro Giannini

Hi indieaz,

add:
$layer-set(type,MS_LAYER_POLYGON);
$layer-set(status,MS_DEFAULT);  




indieaz ha scritto:

Been doing a lot of tinkering, have been plotting points on maps with variety
of shapes from database sources etc.  However, I'm now against what I
believe should be an extremely simple problem.

I have a set of coordinates (max lat/long and min lat/long) that make up a
rectangle I need to plot onto my map.  I'm pulling my hair out...I get a
.png image out, but it's empty.  Here's an example of the code I'm trying to
use:

$map = ms_newMapObj();
$layer = ms_newLayerObj($map);
$polygon= ms_newShapeObj(MS_SHAPE_POLYGON);
$polyLine = ms_newLineObj();
$polyLine-addXY(60,60);
$polyLine-addXY(75,60);
$polyLine-addXY(75,75);
$polyLine-addXY(60,75);
$polyLine-addXY(60,60);
$polygon-add($polyLine);

$Class = ms_newClassObj($layer);
$Class-set( name,MyClass);
// Create a style object defining how to draw features
$lineStyle = ms_newStyleObj($Class);
$lineStyle-color-setRGB(255,255,0);


and my .map file:

MAP

  STATUS ON
  SIZE 600 400
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG
  extent -180 -90 180 90
  PROJECTION
init=epsg:4326
  END

END
  



--
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Drawing a simple filled polygon with PHP/mapscript

2009-03-10 Thread indieaz

Been doing a lot of tinkering, have been plotting points on maps with variety
of shapes from database sources etc.  However, I'm now against what I
believe should be an extremely simple problem.

I have a set of coordinates (max lat/long and min lat/long) that make up a
rectangle I need to plot onto my map.  I'm pulling my hair out...I get a
.png image out, but it's empty.  Here's an example of the code I'm trying to
use:

$map = ms_newMapObj();
$layer = ms_newLayerObj($map);
$polygon= ms_newShapeObj(MS_SHAPE_POLYGON);
$polyLine = ms_newLineObj();
$polyLine-addXY(60,60);
$polyLine-addXY(75,60);
$polyLine-addXY(75,75);
$polyLine-addXY(60,75);
$polyLine-addXY(60,60);
$polygon-add($polyLine);

$Class = ms_newClassObj($layer);
$Class-set( name,MyClass);
// Create a style object defining how to draw features
$lineStyle = ms_newStyleObj($Class);
$lineStyle-color-setRGB(255,255,0);


and my .map file:

MAP

  STATUS ON
  SIZE 600 400
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG
  extent -180 -90 180 90
  PROJECTION
init=epsg:4326
  END

END
-- 
View this message in context: 
http://n2.nabble.com/Drawing-a-simple-filled-polygon-with-PHP-mapscript-tp2459355p2459355.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users