[mapserver-dev] MapScript drawQuery after draw possible?

Martin Kofahl martin.kofahl at gmail.com
Tue Sep 8 05:00:43 PDT 2015


Hello,
I'm going to port an older MapScript 5 application to the current release
and - probably - getting into trouble with the result cache during draw and
drawQuery. Just to make sure calling drawQuery() right after draw() isn't
utterly wrong, please take a look at the following simplified example.

PREAMBLE:
   $map = ms_newMapObj($map_file);
   $point = ms_newpointObj();

   $point->setXY ...
   $layer = $map->getLayerByName ...
   $layer->queryByPoint ...
   $map->querymap->set('style', MS_SELECTED);

WORKING TEST CASE:
   $map->drawQuery();
   $map->draw();

FAILING TEST CASE: msPostGISLayerGetShape: Assertion `layer->layerinfo !=
((void *)0)' failed.
   $map->draw();
   $map->drawQuery();

There are other non-working cases, like processQueryTemplate after draw and
I wonder if draw closes the queried layer somewhat too early.

Thanks for your investigation!
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20150908/46d6f8cd/attachment.html>


More information about the mapserver-dev mailing list