admin管理员组文章数量:1416014
I'm beginer to js and api
I have an for me big problem..
How to get photo for some places with google places api.
I try with this:
function setLink(i) {
var photo = place.photos;
var sideClick = jQuery("<a class=side_click href='#'></a>");
$(sideClick).html(place.name+photo);
$("#side_bar").append(sideClick).append("<br>");
$(sideClick).on("click", function() {
markers[i].modalWindow_.getDetails(markers[i].place_);
});
}
and I get only something like this:
Hotel Name [object Object]
How to change this [object Object] into url of image?
also i try with:
var photo = place.photos.geturl();
but also dont work...
How to solve this problem?
I'm beginer to js and api
I have an for me big problem..
How to get photo for some places with google places api.
I try with this:
function setLink(i) {
var photo = place.photos;
var sideClick = jQuery("<a class=side_click href='#'></a>");
$(sideClick).html(place.name+photo);
$("#side_bar").append(sideClick).append("<br>");
$(sideClick).on("click", function() {
markers[i].modalWindow_.getDetails(markers[i].place_);
});
}
and I get only something like this:
Hotel Name [object Object]
How to change this [object Object] into url of image?
also i try with:
var photo = place.photos.geturl();
but also dont work...
How to solve this problem?
Share Improve this question asked Jun 30, 2013 at 13:30 Mark WestMark West 2672 gold badges5 silver badges17 bronze badges1 Answer
Reset to default 3place.photos
is an Array , you must select an item of the array to get details for a particular photo
https://developers.google./maps/documentation/javascript/places#places_photos
本文标签: javascriptHow to get photo of place from google places apiStack Overflow
版权声明:本文标题:javascript - How to get photo of place from google places api - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744689098a2619883.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论