[MS4W-Users] MS4W 4.0 WMS issue in PHP Mapscript
julian at gdacorp.com
julian at gdacorp.com
Thu Apr 18 19:59:57 EDT 2019
Hi,
I’m having an issue migrating a PHP Mapscript WMS script from MS4W 3 to
MS4W 4. I have tested the mapfile and it renders fine to a CGI request
with MODE=MAP.
I have updated the deprecated function calls (e.g. ms_newOwsrequestObj
--> new OWSRequest).
(see code below).
GetCapabilities request seem to return a reasonable result (attached).
However, the GetMap requests return nothing, as though stdout is empty.
There are no relevant errors in the MapServer log or the Apache log.
Any ideas on what I’m missing?
Thanks,
Julian
$oMap = new mapObj(“map.map");
$request = new OWSRequest();
$request->setParameter('service','WMS');
$request->setParameter('SLD_VERSION','1.1.0');
msIO_installStdoutToBuffer();
$oMap->owsDispatch($request);
$contenttype = msIO_stripStdoutBufferContentType();
if ($_GET['REQUEST'] == 'GetMap')
{
header('Content-type: image/png');
msIO_getStdoutBufferBytes();
}
else if ($_GET['REQUEST'] == 'GetFeatureInfo')
{
$buffer = msIO_getStdoutBufferString();
header('Content-type: text/plain');
echo $buffer;
}
else if ($_GET['REQUEST'] == 'GetFeature')
{
$buffer = msIO_getStdoutBufferString();
header('Content-type: text/plain');
echo $buffer;
}
else if ($_GET['REQUEST'] == 'GetCapabilities')
{
$buffer = msIO_getStdoutBufferString();
header('Content-type: text/xml');
echo $buffer;
}
else if ($_GET['REQUEST'] == 'GetLegendGraphic')
{
//$this->response->type('png');
header('Content-type: image/png');
ms_iogetStdoutBufferBytes();
}
msIO_resetHandlers();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190418/3721bb0b/attachment.html>
More information about the MS4W-Users
mailing list