[Mapserver-users] MapLab point query modification

Charlton Purvis cpurvis at asg.sc.edu
Fri Sep 5 16:38:33 EDT 2003


Hi, folks:

I couldn't get Maplab point queries to do what I wanted.  As a matter of
fact, I couldn't get them to do anything right off-the-bat.  So I made
the following changes, and all is great.

Problem was, on a single click, the first part of the if/then block that
decides to execute a point or a rect query, only checks to see if
$adMax[0 and 1] are numeric, i.e. do we have a max X,Y for a mouse
selection box?  That seems to be true in all cases, so I added a check
to see if they were identical to $adMin[0 and 1].  If so, a single point
has been clicked.  Otherwise, they've made a rectangle.

./wrapper/drawmap.php
* changed the if/then block under // execute query (line 402) to be:
    if ( ( is_numeric( $adMax[0] ) && is_numeric( $adMax[1] ) ) &&
         ( $adMax[0] != $adMin[0] && $adMax[1] != $adMin[1] ) ) {
        $oResultSet = $oMapQuery->executeRectQuery( $adMin[0],
                                    $adMin[1],$adMax[0], $adMax[1] );
    }
    else {
        $oResultSet = $oMapQuery->executePointQuery( $adMin[0],
                                                        $adMin[1] );
    }

./query.phtml
* changed the if/then block under // execute query (line 124) to be:
    if ( ( is_numeric( $adMax[0] ) && is_numeric( $adMax[1] ) ) &&
         ( $adMax[0] != $adMin[0] && $adMax[1] != $adMin[1] ) ) {
        $oResultSet = $oMapQuery->executeRectQuery( $adMin[0],
                                    $adMin[1],$adMax[0], $adMax[1] );
    }
    else {
        $oResultSet = $oMapQuery->executePointQuery( $adMin[0],
                                                        $adMin[1] );
    }

Maybe I had to do this because of my browser?  I didn't go back to
quintuple-y check the origins of $adMin and $adMax, but the above
solution works for me.

Charlton
 
 
 
Charlton Purvis
(803) 777-8858 : voice
(803) 777-8833 : fax
cpurvis at sc.edu
 
Advanced Solutions Group
Department of Physics and Astronomy
University of South Carolina
Columbia, SC 29208




More information about the mapserver-users mailing list