Fw: [Mapserver-users] PHP MapScript: dynamically add new layer ?

Lars V. Nielsen LVN at gispro.dk
Wed Dec 4 10:44:48 EST 2002


Argh! Solved it myself.

Seems
    $map->propertyName = value;
doesn't work. Apparently it has to be this way:
    $map->set("propertyName",value);

Thought I _had_ tried that procedure, but now at least it works :-)

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
http://hjem.get2net.dk/lars-online/
WGS84: 10.20'40"E 55.20'20"N
----- Original Message ----- 
From: "Lars V. Nielsen" <LVN at gispro.dk>
To: "MAPSERVER-L" <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, December 04, 2002 3:45 PM
Subject: [Mapserver-users] PHP MapScript: dynamically add new layer ?


> Hi list,
> 
> I'm sure I'm missing something obvious here, so bear with me.
> 
> I'm trying to create and populate a new layer dynamically, and adding it to the map. It executes errorless, but yields no result.
> If I add the wanted content statically in the map file, it comes out as expected.
> 
> My code's as follows:
> 
> $map = ms_newMapObj($map_path.$map_file);
> 
> $lyr = ms_newLayerObj($map);
> $lyr->name = "myLayer";
> $lyr->type = MS_LAYER_RASTER;
> $lyr->status = MS_ON;
> $lyr->data = "myRasterPicture.jpg";
> 
> $image=$map->draw();
> $image_url = $image->saveWebImage(MS_GIF,1,1,0);
> 
> Please help to enligthen my ignorance. I'm still on game level 1 :-)
> 
> Best regards/Med venlig hilsen
> Lars V. Nielsen
> GisPro, Denmark
> http://www.gispro.dk/
> http://hjem.get2net.dk/lars-online/
> WGS84: 10.20'40"E 55.20'20"N
> 




More information about the mapserver-users mailing list