[mapserver-users] Rectangle and Line

Antti J. Lind anttij.lind at birdlife.fi
Wed Feb 17 09:58:50 PST 2016


Hi,

I try to add rectangle and line on map, but there has not been any 
success. I just can add points on map.

My Mapfile's layer show like this:
LAYER
    NAME "boxes"
    STATUS OFF
    TYPE POINT
    CLASS
	STYLE
	   SYMBOL "circle"
            SIZE 5
            COLOR 0 255 0
	   OUTLINECOLOR 0 0 0
         END
    END
END

And I can add points to map with php mapscript as:

$featlayer = $map->getLayerByName("boxes");
$drawing = ms_newShapeObj(MS_SHAPE_POLYGON);
$lineObject = ms_newLineObj();
$a = $_point['0'];
$b = $_point['1'];
$c = $_point['2'];
$d = $_point['3'];
$lineObject->addXY($b, $a);
$lineObject->addXY($d, $c);
$drawing->add($lineObject);
$featlayer->addFeature($drawing);
$featlayer->set("status", 1);

If I change TYPE to LINE, just poists disappear.

Mapserver show points on map ok. But how to draw a line between points 
or rectangle , with same limits?

--
Antti J. Lind



More information about the mapserver-users mailing list