= WMS Wrapper example = - source: https://lists.ms4w.com/pipermail/ms4w-users/2019-May/000343.html == SWIG !MapScript (MS4W 5.x) == * name the following file 'wms-wrapper.php' {{{ #!php $v) { $request->setParameter($k, $v); } ## Dispatch request $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(); } ## Reset handler and cleaup added msIO_resetHandlers(); msCleanup(); ?> }}} * GetCapabilities request: http://127.0.0.1/wms-wrapper.php?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities * GetMap request: http://127.0.0.1/wms-wrapper.php?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-180,-90,180,90&SRS=EPSG:4326&WIDTH=953&HEIGHT=480&LAYERS=ocean&STYLES=&FORMAT=image/jpeg&TRANSPARENT=true