[mapserver-users] Rectangle and Line

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Wed Feb 17 14:44:33 PST 2016


What happens if you ditch the SYMBOL and SIZE from the style definition?

-----Original Message-----
From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Antti J. Lind
Sent: Wednesday, February 17, 2016 11:59 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Rectangle and Line

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

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list