G'day Ben, I'm still working through this myself, but some thoughts below. there is a very helpful powerpoint called php_mapscript_mum2.ppt from DMSolutions, google it and get it. Also, bookmark if you haven't already.
I might have this wrong, but you seem to have to turn your pointObj into a lineObj to add it to a shapeObj to add to the map. This is how I do it : (the str_replace is to deal with , decimals) $outbreakshape = ms_newShapeObj(MS_SHAPE_POINT); #B now add the points... foreach($dispmappoint->itemlist as $ob_id=>$locn) { #B make a point $outpoint = ms_newPointObj(); $outpoint -> setXY($locn[1],$locn[0]); #B Add it to a line object $obline = ms_newLineObj(); $obline->add($outpoint); #B Add it to our shape $outbreakshape->add($obline); } $dislayer->addFeature($outbreakshape); #B then add the feature to the map. Now try drawing it.
No, it doesn't need one (or it didn't @ 4.8) you can just use $map=ms_newMapObj('',$mapserver_path);
Others could answer this I'm sure... but although it seems a bit annoying at first, it is great for reusing code. I guess they have one function in the class that sets any variable. Good luck, and if I have it wrong, I'd be delighted to be corrected, or to see some smarter code. cheers Ben -- Ben Madin REMOTE INFORMATION t : +61 8 9192 5455 f : +61 8 9192 5535 m : 0448 887 220 Broome WA 6725 Out here, it pays to know... |
