Draw point by using phpMapscript

Murat BEYHAN beyhan at DEPREM.GOV.TR
Mon Sep 25 06:24:52 EDT 2006


Dear Friends;

I have found some information on the list archieve.
And I have added Camden's solution to my mapscript.
But still I could not draw a point on the map.
What Am I do wrong?
Any idea would be appreciated....


Regards 
Murat

The code are here...

function add_point_to_layer($layer, $longitude, $latitude) {
  // create and initialize new point object
   $point = ms_newPointObj();
   $point->setXY($longitude, $latitude);
   // create and initialize new line object
   $line = ms_newLineObj();
   $line->add($point);
   // create and initialize new shape object
   $shape = ms_newShapeObj(MS_SHAPE_POINT);
   $shape->add($line);
   // add our shape
   $layer->addFeature($shape);
 }
 

 $map_path="/var/www/html/zone/";
 $map = ms_newMapObj($map_path."zone.map");
 $map->setExtent($nMinX, $nMinY, $nMaxX, $nMaxY); 

 $layer = ms_newLayerObj($map);
 $layer->set("name","Point");
 $layer->set("type",MS_LAYER_POINT);
 $layer->set("status", MS_ON);
 add_point_to_layer($layer, $lon, $lat);


 $ref = $map->drawreferencemap();
 $legend=$map->drawLegend();

$image=$map->draw(); 

 
    
    

 
  $map_url=$image->saveWebImage();
  $ref_url = $ref->saveWebImage();
  $legend_url=$legend->saveWebImage();  
 



On Mon, 25 Sep 2006 10:43:42 +0300, Murat BEYHAN wrote
> Dear friends;
> 
> I'm trying to draw a point on the map by using phpMapscript.
> My code :
> 
> $lat=40.15
> $lon=38.45 
> $map_path="/var/www/html/zone/";
> $map = ms_newMapObj($map_path."zone.map");
> $point=ms_newPointObj($lat,  $lon);
> 
> $map_url=$image->saveWebImage();
> $st_pos_url=$image1->saveWebImage();
> 
> $image=$map->draw();
> $image1=$point->draw();
> 
>  <html><IMG SRC=$map_url> <IMG SRC=$st_pos_url></html>
> 
> I would like to see a point as a layer on the map.
> But I couldn't do that.
> What is my mistake.
> Thank you...
> Murat.
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.


--
Open WebMail Project (http://openwebmail.org)


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the mapserver-users mailing list