[Mapserver-users] pointObj->draw() not working!

Ken-ichi Ueda kueda at wso.williams.edu
Sat Apr 10 17:41:53 EDT 2004


Thanks Daniel!  Your script works like a charm.  The problem was that I 
hadn't set TRANSFORM=false for that layer, and when I did, my original 
script worked too.

-Ken-ichi


On Apr 10, 2004, at 11:02 AM, Daniel Morissette wrote:

> Ken-ichi Ueda wrote:
>> Hi list.  Although my previous addPoint problem remains unanswered 
>> and unsolved, I have yet another problem.  For some reason 
>> phpMapScript's pointObj->draw() isn't working either!  I've put 
>> together what I think is a pretty trivial test of the function, and 
>> it doesn't give any error messages, but it also doesn't draw the 
>> point I want it to.  I've included my version info and the test 
>> script below.  Please respond!  Even if it looks like it should work 
>> and you're clueless.  I just want a little feedback.
>
> Something may be missing in your layer definition, but without seeing 
> it we can't tell.  Here is a modified version of your script that 
> creates its own layer, and does display the symbol properly.  You 
> should compare your layer definition with what is set in this example. 
>  Also note that if you want to draw labels then you may have to either 
> turn the labelcache off, or call $map->drawLabelCache() after drawing 
> the pointObj.
>
>
>
> <?php
>
> dl('php_mapscript.so');
>
> // Default values and configuration
>
> $map_path = 
> "/Library/WebServer/Documents/maplab/projects/Naturalists/";
> $map_file = "naturalists.map";
>
> $map = ms_newMapObj($map_path.$map_file);
>
> $daLayer = ms_newLayerObj($map);
> $daLayer->set("type", MS_LAYER_POINT);
> $daLayer->set("transform", MS_FALSE);
> $daLayer->set("status", MS_ON);
> $class = ms_newClassObj($daLayer);
> $style = ms_newStyleObj($class);
> $style->color->setRGB(255,0,0);
> $style->set("symbolname", "circle");
> $style->set("size", 10);
>
> $my_point = ms_newpointObj();
> $my_point->setXY(217,240);
>
> $image = $map->draw();
> $my_point->draw( $map, $daLayer, $image, 0, "Temp Point" );
>
> $image_url=$image->saveWebImage();
>
> ?>
>
> <html>
> <head><title>point draw test</title>
> </head>
>
> <body>
>
> <img SRC="<?php echo $image_url?>" align="left">
>
> </body>
> </html>
>
>
>
> -- 
> ------------------------------------------------------------
>  Daniel Morissette               dmorissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list