[mapserver-users] featureObj in mapscript

Steve Lime steve.lime at dnr.state.mn.us
Tue Jan 22 14:36:32 EST 2002


Inline features are nothing more than regular shapes in MapScript 3.5.
Version 3.3 may have been different though. To add features you build a
shapeObj up from points and lines and then use the layer addFeature
method to add it to a layer. The shapeObj has a text
member that holds text associated with the feature.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Walt Lin <joemayfair at usa.net> 01/20/02 23:55 PM >>>
Hi, I have a question about generating a new featureObj and using it in
mapscript (mapserver 3.3).  I want to recreate this through mapscript:

    FEATURE
       POINTS 620 277 END
       TEXT 'some text'
	END

I want to do this through mapscript because I want the coordinates in
the POINTS to be dynamic.  I can do this fine:
my $feature = new featureObj;
$feature->{text} = "some text";

but when i try any of these, mapscript just hangs until i kill it.

$feature->add("620 277");
$feature->add("POINTS 620 277 END");
$feature->add("620,277");

what is the correct way to do this?  (and no, i cannot set
$feature->{points}).  It seems like the documentation is lacking here.

Thanks,
Walt






More information about the mapserver-users mailing list