[Geomoose-users] Fwd: Highlighting issue (Mapserver layer)

Jim Klassen klassen.js at gmail.com
Tue Oct 16 08:32:37 PDT 2012


On Oct 16, 2012, at 10:08 AM, Matej Mailing wrote:
> 
> doesn't work as it should. The features are successfully added in the
> for loop as points, but then it stops and I get a blank image. I am
> using Ubuntu and have found out some issues with loadparams() and
> suggestions to replace it with
>        foreach ($_GET as $k=>$v) {
>                $request->setParameter($k, $v);
>        }
> 

My ruby dynamic WMS server MapScript code calls setParameters() instead of loadparams(), so this seems reasonable.

	map = "MAP .... END" # shortened because it doesn't matter in this example
        map = Mapscript::msLoadMapFromString(map, "/tmp")

        req = Mapscript::OWSRequest.new()
	cgi = CGI.new()
	params = cgi.params
        params.each do |k,v|
            v.each do |vv|
                req.setParameter(k, vv)
            end
        end

        Mapscript::msIO_installStdoutToBuffer()

        map.OWSDispatch(req)

        ct = Mapscript::msIO_stripStdoutBufferContentType()
        res = Mapscript::msIO_getStdoutBufferBytes()
        print "Content-type: #{ct}\n\n"
        print res


More information about the Geomoose-users mailing list