I'm trying to learn mapscript by converting a .map file into php mapscript that does not use the file. <br>It's going well except for not being able to duplicate a very simple piece of mapfile to mapscript. <br><br>The main problem is FEATURE I think.
<br><br>I have also manipulating the layer with php and have success except for changing the text or the point, again the features. <br><br>Anyone got a spare minute to set me straight <br><br> LAYER<br> NAME "credits"
<br> STATUS DEFAULT<br> TRANSFORM FALSE<br> TYPE ANNOTATION<br> FEATURE<br> POINTS<br> 200 150<br> END<br> TEXT 'Hello world. Mapserver rocks.'<br>
END<br> CLASS<br> LABEL<br> TYPE BITMAP<br> COLOR 0 0 0<br> END<br> END<br> END <br><br>This is my attempt: <br>//credits<br><br>//add layer to map
<br>$layerCredits = ms_newLayerObj($map); <br>$layerCredits->set("name", "writeSomething"); <br>$layerCredits->set("type", MS_LAYER_ANNOTATION);<br>$layerCredits->set("transform", MS_FALSE);
<br>$layerCredits->set("status", MS_DEFAULT);<br><br><br>//make shape <br>$shapeCredits = ms_newShapeObj(MS_SHAPE_POINT); <br>$shapeCredits->text ="This should be on the map but is not"; <br><br>
//make line <br>$lineCredits = ms_newLineObj(); <br><br>//make point<br>$pointCredits = ms_newPointObj(); <br>$pointCredits->setXY(50,20); <br><br>//add point to line <br>$lineCredits->add($pointCredits); <br><br><br>
//add line to shape <br>$shapeCredits->add($lineCredits); <br><br>//add shape to layer <br>$layerCredits->addFeature($shapeCredits); <br><br>//set up class<br>$classCredits = ms_newClassObj($layerCredits); <br><br>
//set up label <br>$classCredits->label->set("position", MS_CR); <br>$classCredits->label->set("type", MS_BITMAP); <br>$classCredits->label->color->setRGB(255,0,125); <br><br>