Version 18 (modified by 3 years ago) ( diff ) | ,
---|
WMS Wrapper example
SWIG MapScript (MS4W 5.x)
- name the following file 'wms-wrapper.php'
<?php $oMap= new mapObj("/ms4w/apps/local-demo/local.map"); ## Ready stdout for data capture msIO_installStdoutToBuffer(); ## Create OWS Request object $request = new OWSRequest(); ## Get Request foreach ($_GET as $k=>$v) { $request->setParameter($k, $v); } ## Dispatch request $oMap->OWSDispatch($request); unset($oMap); $contenttype = strtolower(msIO_stripStdoutBufferContentType()); ## Capabilities Request if ($contenttype == "text/xml; charset=utf-8"){ header('Content-type: application/xml; charset=utf-8'); echo msIO_getStdoutBufferString(); } ## GetMap png else if ($contenttype == 'image/png'){ header('Content-type: image/png'); 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
Note:
See TracWiki
for help on using the wiki.