[Fwd: Re: [maplab-users] links from map to jpg]

kgrootendorst at baird.com kgrootendorst at baird.com
Thu Sep 2 11:43:57 EDT 2004


Steffan,
Changing the 'for each' statement worked!!! The attributes were displayed 
and I was able to click on the link and see the right photo.
However, when I query other layers, I do not receive any attributes for 
them.

As I side note, how can you modify it so that the picture automatically 
appears in the query window by itself when the feature is clicked (eg. the 
user does not have to click on a link in the query results window to see 
the photo)?

Using var_dump($aRow)  I get the following:

array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} 


Using var_dump($aRows) I get this:

array(1) { [0]=> array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> 
string(19) "-7.90000000000e+001" ["Lat_DD"]=> string(18) 
"4.30000000000e+001" ["MS_PATH2"]=> string(40) 
"http://localhost/photoalbum/DSCN4329.JPG" ["SHAPE_INDEX"]=> int(0) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) } } array(1) { [0]=> 
array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} } array(1) { [0]=> array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> 
string(19) "-7.90000000000e+001" ["Lat_DD"]=> string(18) 
"4.30000000000e+001" ["MS_PATH2"]=> string(40) 
"http://localhost/photoalbum/DSCN4329.JPG" ["SHAPE_INDEX"]=> int(0) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) } } array(1) { [0]=> 
array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} } array(1) { [0]=> array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> 
string(19) "-7.90000000000e+001" ["Lat_DD"]=> string(18) 
"4.30000000000e+001" ["MS_PATH2"]=> string(40) 
"http://localhost/photoalbum/DSCN4329.JPG" ["SHAPE_INDEX"]=> int(0) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) } } array(1) { [0]=> 
array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> string(19) 
"-7.90000000000e+001" ["Lat_DD"]=> string(18) "4.30000000000e+001" 
["MS_PATH2"]=> string(40) "http://localhost/photoalbum/DSCN4329.JPG" 
["SHAPE_INDEX"]=> int(0) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) 
} } array(1) { [0]=> array(7) { ["Id"]=> string(1) "0" ["Long_DD"]=> 
string(19) "-7.90000000000e+001" ["Lat_DD"]=> string(18) 
"4.30000000000e+001" ["MS_PATH2"]=> string(40) 
"http://localhost/photoalbum/DSCN4329.JPG" ["SHAPE_INDEX"]=> int(0) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(5) } }


When I select another a non-hyperlinking feature (such as a county) and 
use var_dum($aRow) I get this:

array(8) { ["PROV"]=> string(2) "ON" ["NAME"]=> string(6) "Halton" 
["POP1996"]=> string(6) "339875" ["DWELL1996"]=> string(6) "118405" 
["SHORE_AREA"]=> string(9) "970.10185" ["SHAPE_INDEX"]=> int(40) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(0) } array(8) { ["PROV"]=> 
string(2) "ON" ["NAME"]=> string(6) "Halton" ["POP1996"]=> string(6) 
"339875" ["DWELL1996"]=> string(6) "118405" ["SHORE_AREA"]=> string(9) 
"970.10185" ["SHAPE_INDEX"]=> int(40) ["TILE_INDEX"]=> int(-1) 
["LAYER_INDEX"]=> int(0) } array(8) { ["PROV"]=> string(2) "ON" ["NAME"]=> 
string(6) "Halton" ["POP1996"]=> string(6) "339875" ["DWELL1996"]=> 
string(6) "118405" ["SHORE_AREA"]=> string(9) "970.10185" 
["SHAPE_INDEX"]=> int(40) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> 
int(0) } array(8) { ["PROV"]=> string(2) "ON" ["NAME"]=> string(6) 
"Halton" ["POP1996"]=> string(6) "339875" ["DWELL1996"]=> string(6) 
"118405" ["SHORE_AREA"]=> string(9) "970.10185" ["SHAPE_INDEX"]=> int(40) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(0) } array(8) { ["PROV"]=> 
string(2) "ON" ["NAME"]=> string(6) "Halton" ["POP1996"]=> string(6) 
"339875" ["DWELL1996"]=> string(6) "118405" ["SHORE_AREA"]=> string(9) 
"970.10185" ["SHAPE_INDEX"]=> int(40) ["TILE_INDEX"]=> int(-1) 
["LAYER_INDEX"]=> int(0) } array(8) { ["PROV"]=> string(2) "ON" ["NAME"]=> 
string(6) "Halton" ["POP1996"]=> string(6) "339875" ["DWELL1996"]=> 
string(6) "118405" ["SHORE_AREA"]=> string(9) "970.10185" 
["SHAPE_INDEX"]=> int(40) ["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> 
int(0) } array(8) { ["PROV"]=> string(2) "ON" ["NAME"]=> string(6) 
"Halton" ["POP1996"]=> string(6) "339875" ["DWELL1996"]=> string(6) 
"118405" ["SHORE_AREA"]=> string(9) "970.10185" ["SHAPE_INDEX"]=> int(40) 
["TILE_INDEX"]=> int(-1) ["LAYER_INDEX"]=> int(0) } array(8) { ["PROV"]=> 
string(2) "ON" ["NAME"]=> string(6) "Halton" ["POP1996"]=> string(6) 
"339875" ["DWELL1996"]=> string(6) "118405" ["SHORE_AREA"]=> string(9) 
"970.10185" ["SHAPE_INDEX"]=> int(40) ["TILE_INDEX"]=> int(-1) 
["LAYER_INDEX"]=> int(0) } 

As I mentioned before, attributes for this layer are not displayed in the 
query window.

Thanks for your help!

Kevin

 



Steffen Macke <sdteffen at web.de> 
Sent by: sdteffen at web.de
09/02/2004 11:18 AM

To
kgrootendorst at baird.com
cc

Subject
Re: [Fwd: Re: [maplab-users] links from map to jpg]






Kevin,

the first snippet is using strcasecmp() in the wrong way.
In the second one, $key is not initialized. Change

 foreach ( $aRow as $xCell )

to 

 foreach ( $aRow as $key => $xCell )

I would also like to draw your attention that there's a difference
between $aRow and $aRows[0]

Could you tell us what

var_dump($aRow); 

and

var_dump($aRow);

give as output? - you should add this inside the loop
over all rows.
You should also check whether there are any rows retrieved at all.

Steffen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20040902/626e83e8/attachment.htm


More information about the Maplab-users mailing list