我正在使用storelocater.js獲取Google地圖中的多個位置,並根據圖像位置顯示信息。我只能顯示一個圖像,但我想在信息面板中顯示多個圖像。鏈接此在javascript中打印對象數組,並在html標記中打印
這裏是我的代碼
var panelDiv = document.getElementById('panel');
storeLocator.Panel.NO_STORES_IN_VIEW_HTML_ = '<li class="no-stores">The nearest outlet:</li>';
var Store = storeLocator.Store;
Store.prototype.generateFieldsHTML_ = function(fields) {
var html = '';
html += '<div class="store-data">';
if(this.props_['title']){
html += '<div class="title"><div class="img-list clearfix">' +
for (var i = 0; i <= this.props_[images].length; i++) {
console.log(this.props_[images[i]]);
// <img src=' + this.props_['images'] + '>
}
+ '</div></div>'
}
html += '</div>';
return html;
}
var data = new storeLocator.StaticDataFeed;
data.setStores([
new storeLocator.Store('store02', new google.maps.LatLng(27.67663,85.31093), null, {images: ["img/thapathalil.jpg","img/thapathalil.jpg","img/thapathalil.jpg"]})
]);
它表明: 未捕獲的SyntaxError:意外的令牌......
我怎樣才能解決這個?我怎樣才能獲取位置的「圖像」
THANKS內提前
請問您可以添加您遇到的問題/錯誤嗎?或者可能是如何渲染? –
我編輯了我的代碼。請檢查。 –
@NiranjanShakya你在下面檢查了[**我的答案**](https://stackoverflow.com/a/46663141/3669624)?! –