Error when create annotation layer in PHPMapscript

Daniel Morissette dmorissette at MAPGEARS.COM
Tue Oct 23 12:32:19 PDT 2007


Krung Saengpole wrote:
> Hi all,
>  
> I have a question about creating annotation layer using phpmapscript. I 
> created layer as follow:
>  
>  $layer=ms_newLayerObj($map);
>  $layer->set("name", $name);
>  $layer->set("data", $data);
>  $layer->set("type", MS_LAYER_ANNOTAION);

I'm not convinced that this alone would explain the errors you got, but 
there is a typo here... should be MS_LAYER_ANNOTATION... perhaps try 
fixing that and see.

[...]
> when it came to
>  
> $img=$map->draw();
>  
> it showed 9 or 10 sentences of:
> ** 
> *Warning*: [MapServer Error]: msQueryByRect(): No matching record(s) 
> found. in *D:\Work\testing\area50.php* on line *40*
> *.....*
> *.....*
> *.....*
> 

Could it be that you made a queryByRect() between the time the layer was 
created and the time at which you call $map->draw()?

Perhaps try calling ms_ResetErrorList() after the queryByRect() or 
before the call to $map->draw(). I suspect that the query leaves 
warnings in the error stack and this may confuse the $map->draw() method.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the MapServer-users mailing list