[MS4W-Users] PHP Mapscript Swig
Jeff McKenna
jmckenna at gatewaygeomatics.com
Fri May 10 12:01:10 EDT 2019
Hi,
Great to see your test scripts. Could you add them in the "Additional
Notes, Tips" section of the wiki? https://ms4w.com/trac
I haven't tested your code, but there was a recent change in the
MapServer source that will be included in the next MapServer release:
see
https://github.com/mapserver/mapserver/pull/5778/files#diff-127c91f36292dd4e75e861fb07c29f1f
If your organization can help fund the next MS4W release with the next
MapServer version and all of its many necessary changes, and help things
move along and become available for the whole community, definitely
please let me know and contact me directly.
Hope that info helps you. Have a nice weekend,
-jeff
--
Thank you for using MS4W.
"MS4W: open doors as well as windows"
--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/
On 2019-05-10 11:36 AM, Sven Schroeter via MS4W-Users wrote:
> Hi,
>
> I'm using the new MS4W 4.0.0 and try to build a WMS Wrapper for the new
> PHP Mapscript with Swig.
> I am currently writing the complete PHP mapscript code from my client so
> that it runs with both versions, so far this works fine,
> msIO_getStdoutBufferBytes() is the only problem so far...
>
> Here is my Test Code for the last MS4W 3.3.0 with old PHP Mapscript
> This works fine trying two example requests with getCapabilities and getMap
>
> #############################################
> ...
>
> $oMap= ms_newMapObj($mymapfile);
>
> ms_ioinstallstdouttobuffer();
>
> $request = ms_newowsrequestobj();
>
> //Get Request
> foreach ($_GET as $k=>$v) {
> $request->setParameter($k, $v);
> }
>
> $oMap->owsdispatch($request);
> $oMap->free();
> unset($oMap);
>
> $contenttype = strtolower(ms_iostripstdoutbuffercontenttype());
>
> //Capabilities Request
> if ($contenttype == "application/vnd.ogc.wms_xml; charset=utf-8"){
> header('Content-type: application/xml; charset=utf-8');
> echo ms_iogetstdoutbufferstring();
> }
>
> //getMap jpeg
> else if ($contenttype == 'image/jpeg'){
> header('Content-type: image/jpeg');
> echo ms_iogetStdoutBufferBytes();
> }
>
> ...
>
>
> and here ist the same Code using the new Swig Version:
> The getCapabilities Request works fine, not the getMap Request.
> I get no picture but only this text:
> Resource id #7
>
> #############################################
> ...
>
> include("../includes/phpmapscriptng-swig/mapscript.php");
> $oMap= new mapObj($mymapfile);
>
> msIO_installStdoutToBuffer();
>
> $request = new OWSRequest();
>
> //Get Request
> foreach ($_GET as $k=>$v) {
> $request->setParameter($k, $v);
> }
>
> $oMap->OWSDispatch($request);
>
> unset($oMap);
>
> $contenttype = strtolower(msIO_stripStdoutBufferContentType());
>
> //Capabilities Request
> if ($contenttype == "application/vnd.ogc.wms_xml; charset=utf-8"){
> header('Content-type: application/xml; charset=utf-8');
> echo msIO_getStdoutBufferString();
> }
>
> //getMap jpeg
> else if ($contenttype == 'image/jpeg'){
> header('Content-type: image/jpeg');
> echo msIO_getStdoutBufferBytes();
> }
>
> ...
>
>
> Any idea?
>
> Thanks Sven
>
>
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.ms4w.com
> https://lists.ms4w.com/mailman/listinfo/ms4w-users
More information about the MS4W-Users
mailing list