0

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 holding the widget w/some text saying 'no photos available'. Something like that...

4

2 回答 2

0

api有点难过。不要认为它有解决方案。

在他们的博客上看到这个线程

http://www.panoramio.com/forum/viewtopic.php?t=31697&sid=b6d56e00ceffd6cda312da185242107a

于 2011-06-01T17:05:56.177 回答
0

这个 Panoramio JavaScript API 小部件围绕纬度/经度对创建一个边界框,然后返回这些边界内的所有照片。

另一种 Panoramio JavaScript API 小部件,您还可以在其中通过示例和代码更改背景颜色。

我创建了一个blogspot 页面,在其中创建了许多 Panoramio JavaScript 和 HTML API 小部件。

作曲时不显示,发表后显示。

<div dir="ltr" style="text-align: center;" trbidi="on">
<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&amp;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>
于 2013-10-21T08:06:48.113 回答