I am using Panoramio API to display area images around given location But its not displaying the images The code below: <?php $addr=$row['e_7'].",".$row['e_15'].",".$row['e_11'].",België"; $arrs=doGeo($addr); $minx=$arrs[1]-100; $maxx=$arrs[1]+100; $miny=$arrs[0]-100; $maxy=$arrs[0]+100; $ch = curl_init(); $url="http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=20&minx=".$minx."&miny=".$miny."&maxx=".$maxx."&maxy=".$maxy."&size=small"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $s1=substr($output,strpos($output,'[')+1,(strpos($output,']')-strpos($output,'['))); $s1=str_replace("{","",$s1); $s1arr=explode("}",$s1); $xx=0; $newarr=array(); for($i=0;$i<count($s1arr);$i++) { $s2arr[$i]=explode(",",$s1arr[$i]); for($j=0;$j<count($s2arr[$i]);$j++) { if($s2arr[$i][$j]!='') { $p=explode('":',$s2arr[$i][$j]); $p1=trim(str_replace('"','',$p[0])); $p2=trim(str_replace('"','',$p[1])); if($p1!='') $newarr[$xx][$p1]=$p2; } } $xx++; } ?> <div align="right"> <p></p> <p align="center"><span class="style11 style74 style76">Pictures from the area </span></p> </div> <table border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#003333"> <tbody> <?php $count = 0; echo "<tr>"; //print_r($newarr); for($i=0;$i<count($newarr);$i++) { $count++; if($count==5) { echo "</tr><tr>"; $count=1; } //scaleImg(100,100,125); echo '<td><div align="center"><a href="'.$newarr[$i]['photo_url'].'" target="_top">'; echo '<img src="'.$newarr[$i]['photo_url'].'" border="0">'; echo '</a> </div></td>'; } if($count<5) echo '</tr>'; ?> </tbody> </table>
Try replace echo '<img src="'.$newarr[$i]['photo_url'].'" border="0">'; PHP: with echo '<img src="'.$newarr[$i]['photo_file_url'].'" border="0">'; PHP: It works for me. Thanks for your code. Charlie
hi, thank you for your code about the Panoramio API. I have a problem with the deGeo function. My site can't find the deGeo function in line 3. Do you know the answer for this problem? Best regards from Austria, moosi
Here is a Panoramio photos viewer called PanoraView for iPhone or iPod touch in AppStore, which probably uses Panoramio API. It shows photos on the map and you can use iPhone GPS to jump to your current location. Really cool app..