1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Panoramio API

Discussion in 'PHP' started by ahdsan, Aug 26, 2009.

  1. #1
    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>
     
    ahdsan, Aug 26, 2009 IP
  2. buscxc

    buscxc Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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
     
    buscxc, Sep 8, 2009 IP
  3. ahdsan

    ahdsan Member

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    thanks it worked !
     
    ahdsan, Sep 9, 2009 IP
  4. moosi

    moosi Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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
     
    moosi, Jan 31, 2010 IP
  5. igvm

    igvm Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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..
     
    igvm, May 2, 2010 IP