Emanuele,

I use the queryresults string like this:

         <tr>
         <td>
         <?php
          $yy = $_SESSION['queryresults'];
          $yy = ereg_replace('TABLE id="tab_adapar" class="sortable" 
width="100%" border=0 cellspacing=0 cellpadding=0','TABLE BORDER=1',$yy);
          $yy = preg_replace('{<div 
class="LAYERHEADER">.*?<\/div>}','',$yy);
          $yy = ereg_replace('<TH>\@</TH>','',$yy);
          $yy = preg_replace('(<td class="zoomlink.*?<\/td>)','',$yy);
          $yy = ereg_replace('Zoom to Selected Features','',$yy);
          echo $yy
         ?>
         </td>
         </tr>

the regular expressions strip off the javascript for the zoom and any 
formatting that is used for the info.phtml window.  I have the above code in 
printmap.phtml so that whatever printed in infowin also prints in the print 
view as a simple table.  I use css in a class that I added to default.css 
file for display format for that table.

Once its in this format you can also break it into an array more easily by 
using a regular espression to convert "<td>" ',' or '|' and '<tr>' to '\n' 
or '<br>' then use explode to populate the array segments.

Also, because this basically just builds a nice table you could use css to 
display it the way you like.

I also keep a set of arrays of the geometry and the oids that the queries 
return and use those to build a simple table of points to zoom to that I 
display in a pop up window.  I create that array from the queryresults that 
info.phtml uses.

That converts this:

<div class="LAYERHEADER">Water Features</div>
<TABLE id="tab_adawatp" class="sortable" width="100%" border=0 cellspacing=0 
cellpadding=0>
<TR><TH>@</TH><TH>AREA</TH><TH>PERIMETER</TH><TH>ADAWATP_</TH><TH>ADAWATP_ID</TH><TH>NAME</TH><TH>DXF_LAYER</TH><TH>LAYER</TH><TH>CLASS</TH></TR>
<tr><td class="zoomlink"><a 
href="javascript:opener.parent.mapFrame.zoom2extent(0, 
0,'2467195.6094546+679003.71918006+2468423.2390913+680437.11455061')"><img 
src="images/zoomto.gif" 
border="0"></a></td><TD>41025.32</TD><TD>4563.05</TD><TD>3648</TD><TD>3089</TD><TD>Farr
 
Lateral</TD><TD>C-NWAT-CANL</TD><TD>35</TD><TD>minor</TD></tr>
<tr><td class="zoomlink"><a 
href="javascript:opener.parent.mapFrame.zoom2extent(0, 
0,'2465058.5054146+677741.16531989+2467480.600103+680424.40825578')"><img 
src="images/zoomto.gif" 
border="0"></a></td><TD>146629.74</TD><TD>7879.29</TD><TD>3650</TD><TD>2972</TD><TD>Rawson
 
Canal</TD><TD>C-NWAT-CANL</TD><TD>35</TD><TD>minor</TD></tr>

...
...
...
Much data snipped....


To this:

AREA    PERIMETER       ADAWATP_        ADAWATP_ID      NAME    DXF_LAYER       
LAYER   CLASS
41025.32        4563.05 3648    3089    Farr Lateral    C-NWAT-CANL     35      
minor
146629.74       7879.29 3650    2972    Rawson Canal    C-NWAT-CANL     35      
minor
21814.81        3240.51 3652    3136    Tenmile Creek   C-NWAT-CANL     35      
minor
18748.42        2015.36 3678    3161    Farr Lateral    C-NWAT-CANL     35      
minor


If the code didn't come through because of email client formatting I put 
most of this email to the text file I've attached.

Let me know if you'd like any more help with this.
--
Things are only difficult while you don't understand them.




>From: Armin Burger <armin.burger at gmx.net>
>To: Emanuele Masiero <emanuele_mas at hotmail.com>
>CC: pmapper-users at faunalia.it
>Subject: Re: [Pmapper-users] array with data of feature in info.php
>Date: Sun, 14 May 2006 12:43:26 +0200
>
>Emanuele,
>
>it might help if you use the terminology used in pmapper when describing
>functionalities. I guess with 'rectangle selection' you mean the tool
>that's called 'Select', thus using a rectangle (but also just a point
>click) and applying the map query only on the layer chosen in the
>pull-down menu. The 'Identify' tool is probably what you mean with
>'point selection', this applies to all visible layers that have a
>template set in the map file.
>
>There is nothing to fix since the missing highlight function of the
>identify is made intentionally. Highlighting features of different
>layers makes no sense to me. As mentioned, you can use the 'select' also
>for single mouse clicks. Changing from the select to the identify tool
>does not remove the highlighting, that is also intended to be so. You
>can use the 'refresh' button to do this.
>
>I am an old ArcView 3 user and the behaviour of some functions is
>partially similar to the AV ones, with some modifications for usage by
>casual users.
>
>You can initiate the refresh also all the time when the select tool is
>disabled, just some slight modifications in mapserver.js, eg. the
>'domouseclick(button)' function.
>
>Armin
>
>
>
>Emanuele Masiero wrote:
> > I need to use the data of selected features outputted by info.php.
> >
> >
> >
> > I noticed that in info.php there is the global var
> > $_SESSION[?resultlayers?] that calls the array with SHAPEINDEXes of the
> > selected objects, this is perfect for me.
> >
> >
> >
> > This call works only with ?rectangle selection? and not with ?point
> > selection?.
> >
> > Maybe this problem is the reason of missing highlighting on the map of
> > ?by point? selection.
> >
> > Infact while using ?by point? after a ?by rectangle? selection, old
> > selected features remain turned on.
> >
> >
> >
> > Is it possible to fix the code?
> >
> > Bye
> >
> > Emanuele
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Pmapper-users mailing list
> > Pmapper-users at faunalia.it
> > http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users
>
>_______________________________________________
>Pmapper-users mailing list
>Pmapper-users at faunalia.it
>http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users

-------------- next part --------------
An embedded message was scrubbed...
From: unknown sender
Subject: no subject
Date: no date
Size: 2521
Url: 
http://faunalia.it/pipermail/pmapper-users/attachments/20060514/e547c70d/attachment.eml
 

Reply via email to