[MS4W-Users] Code/help for Dynamic retrieval of value in a dropdown in Queryeditor

Lambha Nongkhlaw lam_hep at yahoo.com
Mon Mar 21 04:29:04 EST 2011


Sir can you help me with the pmapper queryeditor portion regarding retrieving of 

field value not in a textbox but dynamically in a dropdownlist manner... I need 
certain codes for creating a function..

 Lambha Nongkhlaw
MLCU
Meghalaya




________________________________
From: "ms4w-users-request at lists.maptools.org" 
<ms4w-users-request at lists.maptools.org>
To: ms4w-users at lists.maptools.org
Sent: Sat, 19 March, 2011 10:30:01 PM
Subject: MS4W-Users Digest, Vol 83, Issue 8

Send MS4W-Users mailing list submissions to
    ms4w-users at lists.maptools.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.maptools.org/mailman/listinfo/ms4w-users
or, via email, send a message with subject or body 'help' to
    ms4w-users-request at lists.maptools.org

You can reach the person managing the list at
    ms4w-users-owner at lists.maptools.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of MS4W-Users digest..."


Today's Topics:

  1. ms_iogetstdoutbufferstring() returns "empty image" (andrew_peru)


----------------------------------------------------------------------

Message: 1
Date: Fri, 18 Mar 2011 12:34:53 -0700 (PDT)
From: andrew_peru <rummagebin at gmail.com>
Subject: [MS4W-Users] ms_iogetstdoutbufferstring() returns "empty
    image"
To: ms4w-users at lists.maptools.org
Message-ID: <1300476893089-6185879.post at n2.nabble.com>
Content-Type: text/plain; charset=us-ascii

I'm using php mapscript with ms4w v. 3.0.1, which I guess translates to
Mapserver cgi 5.6.6 and Mapscript 5.6.6

I need to load the image produced by a Mapserver WMS into a php variable in
order to perform some on-the-fly image processing before serving it up to a
browser.  

The following php code snippet works but is inefficient because it loads an
image into two different buffers, one of which is never used  (This,
however, was the only way I got the concept to work at all)
.
.
$objMap = ms_newMapobj($map_path.$map_name);
ms_ioinstallstdouttobuffer();              # make output go into mapserver
buffer
$objMap->owsdispatch($request);    # This would print to browser, but goes
to mapserver buffer
ms_ioresethandlers();

ob_start();                                          # make output go into
php buffer
$image = $objMap->draw();              # Instance of Image object
$image->saveImage('',$objMap);      # This would print to browser but goes
to php buffer
$buffer = ob_get_contents();            # Php Buffer (image) contents
placed into variable/memory
ob_end_clean();                                # Output buffer cleaned so
image not printed automatically

header('Content-type: image/png');
echo $buffer;                                      # Image is displayed
successfully in browser
.
.
.

On the other hand this code snippet attempts to bypass the whole the
ob_start() to ob_end_clean() hack, but it fails:
.
.
$objMap = ms_newMapobj($map_path.$map_name);
ms_ioinstallstdouttobuffer();              # make output go into mapserver
buffer
$objMap->owsdispatch($request);    # This would print to browser, but goes
to mapserver buffer
$buffer = ms_iogetstdoutbufferstring();  # This should load mapserver
buffer to php variable
ms_ioresethandlers();

header('Content-type: image/png');
echo $buffer;                                          # Fails with error
message
.
.
Here browser spits out the following error message : 
The image "" cannot be displayed, because it contains errors.

If I comment the header function I can see that ms_iogetstdoutbufferstring()
is returning a stream consisting of the characters "PNG" surrounded by one
or two bytes of binary stuff, nothing else.

Has anybody seen this behavior before?  Should I get a new copy? Modify some
setting?
Any help will be greatly appreciated.


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/ms-iogetstdoutbufferstring-returns-empty-image-tp6185879p6185879.html

Sent from the ms4w-users mailing list archive at Nabble.com.


------------------------------

_______________________________________________
MS4W-Users mailing list
MS4W-Users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ms4w-users


End of MS4W-Users Digest, Vol 83, Issue 8
*****************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20110321/ba173c65/attachment.htm 


More information about the MS4W-Users mailing list