沒關係;這是我的答案。
首先,在HTML文件中,我有這樣的:
<div id="thumbnail_slider"></div>
與滑塊的風格是:
div#thumbnail_slider {
width: 50%;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
position:absolute;
margin-top:1%;
margin-right:1%;
z-index:999999999;
}
img.thumb {
vertical-align: middle;
cursor: pointer;
}
然後,在JavaScript循環,填充圖像的略圖格;注意到,自定義屬性:
$('div#thumbnail_slider').append('<img class="thumb" src="' + feature.properties.Tile + '" lat="' + feature.geometry.coordinates[1] + '" lng="' + feature.geometry.coordinates[0] + '"/>');
最後,處理圖像的點擊抓取自定義屬性:
$('img.thumb').click(function() {
var sourceURL = $(this).attr('src');
var lat = $(this).attr('lat');
var lng = $(this).attr('lng');
//console.log(lat + " " + lng);
});