[mapserver-users] Drawing a Line From A Set Start Point to End Point

Steve Lime Steve.Lime at dnr.state.mn.us
Wed Jul 16 13:25:38 EDT 2008


Start with the obvious...

  - is the extent of the map ok?
  - is there a call to prepare image earlier?
  - you're not checking method return values, perhaps the code is dying at $mypoint->draw?

Plus, is $this_tornado_layer referencing a point or line layer? You're drawing it both ways.

Steve

>>> On 7/16/2008 at 11:01 AM, in message
<200721390807160901y65be3fb9xb2d20ca2277f0235 at mail.gmail.com>, "Lena Olympio"
<myheartsnflorida at gmail.com> wrote:
> Hello,
> I am trying to draw tornado paths on my map that I am creating, but I am
> having a little bit of trouble because now it won't even plot the initial
> point on my map. The following is my code for attempting to draw a line from
> start to finish. If anyone has any helpful information, it would be greatly
> appreciated
> 
> while($row=mysql_fetch_assoc($result)){
>      $mypoint=ms_newPointObj();
>      $mypoint->setXY($row['lon_td'],$row['lat_td']);
>      $myline=ms_newLineObj();
>      $myline->add($mypoint);
>      $endpoint=ms_newPointObj();
>      $endpoint->setXY($row['lon_lift'],$row['lat_lift']);
>      $myline->add($endpoint);
>      $mypoint->draw($map,$this_layer_tornado,$image,0,'');
> }
> 
> //Create the shape object that will be added to the layer
> $shape=ms_newShapeObj(MS_SHAPE_LINE);
> $shape->add($myline);
> $this_layer_tornado->addFeature($shape);
> 
> Thank you,
> Lena



More information about the mapserver-users mailing list