51 | | |
52 | | == Old !MapScript == |
53 | | |
54 | | {{{ |
55 | | #!php |
56 | | <?php |
57 | | |
58 | | $oMap= ms_newMapObj($mymapfile); |
59 | | |
60 | | ms_ioinstallstdouttobuffer(); |
61 | | |
62 | | $request = ms_newowsrequestobj(); |
63 | | |
64 | | //Get Request |
65 | | foreach ($_GET as $k=>$v) { |
66 | | $request->setParameter($k, $v); |
67 | | } |
68 | | |
69 | | $oMap->owsdispatch($request); |
70 | | $oMap->free(); |
71 | | unset($oMap); |
72 | | |
73 | | $contenttype = strtolower(ms_iostripstdoutbuffercontenttype()); |
74 | | |
75 | | //Capabilities Request |
76 | | if ($contenttype == "application/vnd.ogc.wms_xml; charset=utf-8"){ |
77 | | header('Content-type: application/xml; charset=utf-8'); |
78 | | echo ms_iogetstdoutbufferstring(); |
79 | | } |
80 | | |
81 | | //getMap jpeg |
82 | | else if ($contenttype == 'image/jpeg'){ |
83 | | header('Content-type: image/jpeg'); |
84 | | echo ms_iogetStdoutBufferBytes(); |
85 | | } |
86 | | |
87 | | ?> |
88 | | }}} |