Panoramio API - No Images returned?
I'm using the Panoramio API to create a little photo widget like the one you see here at this link. My code sets some options up for retrieving photos, namely by creating a bounding box around a lat/long pair and then returning all photos w/in those bounds.
However, sometimes (depending on the coordinates), no photos are returned and my widget just appears with broken page links (small symbol). Anyone know how to check whether or not the api will in fact return data? I'd like to perhaps replace the contents of the div tag holdi开发者_StackOverflow中文版ng the widget w/some text saying 'no photos available'. Something like that...
the api is kind of sad. dont think it has a solution.
see this thread on their blog
http://www.panoramio.com/forum/viewtopic.php?t=31697&sid=b6d56e00ceffd6cda312da185242107a
this Panoramio JavaScript API widget create a bounding box around a lat/long pair and then returning all photos with in those bounds.
Another type of Panoramio JavaScript API widget in which you can also change background color with example and code is here.
I have made a blogspot page where i have created many Panoramio JavaScript and HTML API widgets.
It does not show in composing mood.It show after publishing.
<div dir="ltr" style="text-align: center;" trbidi="on">
<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&hl=en"></script>
<div id="wapiblock" style="float: right; margin: 10px 15px"></div>
<script type="text/javascript">
var myRequest = {
'tag': 'kahna',
'rect': {'sw': {'lat': -30, 'lng': 10.5}, 'ne': {'lat': 50.5, 'lng': 30}}
};
var myOptions = {
'width': 300,
'height': 200
};
var wapiblock = document.getElementById('wapiblock');
var photo_widget = new panoramio.PhotoWidget('wapiblock', myRequest, myOptions);
photo_widget.setPosition(0);
</script>
</div>
精彩评论