Read and display Panoramio pictures with JSON and ASP

You want to use the Panoramio API to display pictures related to a place? (
Here is the stuff you need:

  • Long/Lat of your place
  • Be able to calculate a min/max value for your Long/Lat
  • Read the Panoramio legal stuff :)



‘ Set the Min and Max long/Lat

x_geolatMin = Cint(x_geolatMin )’ this is your min LAT
x_geolongMin = Cint(x_
geolongMin )’ this is your min LONG
x_geolatMax = Cint(x_geolatMax ) this is your max LAT
x_geolongMax = Cint(x_geolongMax ) this is your max LONG

‘ Set the URL to Panoramio with your LONG/LAT values

PanoURL = “”&x_geolongMin&”&miny=”&x_geolatMin&”&maxx=”&x_geolongMax&”&maxy=”&x_geolatMax

‘ Create the xml object
Set GetConnection = CreateObject(”Microsoft.XMLHTTP”)

‘ Conect to Panoramio…
GetConnection.Open “get”, PanoURL , False

‘ PanoResponse is the response we will get when visiting PanoURL
PanoResponse = GetConnection.responseText

Set GetConnection = Nothing
PanoResponse = replace(PanoResponse ,”"”",”‘”) ‘not mandatory…


Now we have the JSON string, let’s show it with basic Java Script

<SCRIPT type=”text/javascript”>
var myFirstJSON = <%=PanoResponse %>;
for (i=0; i<10; i++)//10 is the limit we want… change it here AND in the PanoUrl if needed

document.writeln(”<img src=’”[i].photo_file_url+”‘><br />”);
document.writeln([i].photo_title+”<br /><br />”);

Now read more on about the JSON values like Autho, file adress etc..

Have fun ;)
You want more? Links:

1 Comment

  1. Jean Said,

    July 4, 2007 @ 12:45 pm

    A class to read JSON in ASP VBscript

    A class to write JSON in ASP VBscript

    A function to clean a JSON string in ASP VBscript

RSS feed for comments on this post