[maplab-users] linking

rosy sakura whitesakura81 at yahoo.com
Tue Feb 15 13:16:30 EST 2005


hi .. i am new here .. i studied the arcview 8.1 to
make a layer for hyperlink. and my data in attribute
are below.. i only add URL attribute

 Fid | Shape | Id | URL |
-------------------------------
   0 | Point |  0 | http://www.yahoo.com
   1 | Point |  1 | http://www.yahoo.com

And i also use this php script in 
/gmf_apps/trymap/query.phtml 

I modify this script according to list mailing list on
september 2  2004.. 
The Problem is .. nothing change in my map in
maplab..i am using maplab2.2 and mapserver 4 ..

 I am hoping somebody will correct me if i am wrong.. 

 //************************************* ADDED FOR
HYPERLINKS*************************************
	    
// loop and use key for titles
	    // $Key is equal to the attribute name, which is
also the header of column

            foreach ($aRows[0] as $key => $value)
            {
			// The purpose of this if loop is to find the only
attribute name we want to display

	      if (strcasecmp($key, "Id") == "Id"||
		  strcasecmp($key, "URL") == "URL")
			 
	$szReturnValue = $szReturnValue.
                   "<td bgcolor=\"E2EFF5\">".
                    "<font face=\"Arial, Helvetica,
sans-serif\" size=\"2\">".                 
                    $key."</font></td>\n";

  	
              
            }

//*********************************************************************************************



 $szReturnValue .= "</tr>\n";

        // loop through the results and format each
row
            foreach ( $aRows as $aRow )
            {
        // add a row for each
        $szReturnValue .= "<tr>\n";



//***********ADDED FOR
HYPERLINK***************************************************************

                // loop and add a cell for each result
                foreach ( $aRow as $xCell )
                {
		
		// $xCell is the attribute value, in this case,when
the $key attribute name is equal to "Id" only display
the value of attribute.

		if (strcasecmp($key, "Id") == "Id")
		   
                {$szReturnValue .= "<td
bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica,
sans-serif\" size=\"2\">". $xCell."</font></td>\n";}

		//when the attribute name is equal to URL, hyperlink
according to the value of attribute, the attribute
value of URL should be simliar as http://... 
		//photoalbum folder with images is put at your web
server.

		else if (strcasecmp($key, "URL") == "URL")
			
			{$szReturnValue .= "<td bgcolor=\"#ffffff\"> <a
href=\"".$xCell."\"> Click here to
document</a></td>\n";}          
		}
                $szReturnValue .= "</tr>\n";
            }

//*********************************************************************************************






=====

learn to control instict will develop the ability itself...( )


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Maplab-users mailing list