0

I`m using panoramio api to show some pictures about a destination. Unfortuanatly for some destinations they dont have any images.

How could i test if panoramio doesnt have any results so i can display something else.

I tried replacing it usig livequery:

$('#div_attr_ex_photo').find('.panoramio-wapi-empty-img').livequery(function(){
    //replace panoramio with something
})

This work, but only if i click, or press a button ( probably when any event occures ). Can`t imagine why...

Any other method that does the job is welcome.

4

1 回答 1

0

很简单,只要去panoramio网站,然后从panoramio网站打开世界地图。然后去指定的位置,需要经纬度。

然后您在地址栏中找到纬度和经度,例如在此地址中。

http://www.panoramio.com/map#lt=32.739485&ln=70.491211&z=9&k=1&a=1&tab=1&pl=all

lt=32.739485 =>纬度 ln=70.491211 =>经度

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

另一种 Panoramio JavaScript 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:31:01.123 回答