我有一个类似于GEOJson的文件
{
"type": "Feature",
"geometry": {
"type": "MultiPoint",
"coordinates": [
[
-123.77252789,
44.37857221
],
[
-123.77317087,
44.37864694
],
[
-123.77383407,
44.37875853
],
[
-123.7744676,
44.37886305
]
]
},
"properties": {
"time": [
1369786338000,
1369786340000,
1369786342000,
1369786344000
],
"Temp":[70F,60F,72F,80F],
"Title": "Car1"
}
}
使用 Leaflet Playback,我能够使标记移动,但我希望每个标记在移动时都有自己的弹出窗口显示时间和温度。我尝试过像这样做:
var playbackOptions = {
marker: function (featureData) {
return {
getPopup: function (feature) {
return "Temp: " + feature.properties.Temp + "at " + feature.properties.time;
}
};
}
};
var playback = new L.Playback(map, demoTracks, null, playbackOptions);
但它一直给我每个标记的所有时间和温度数组,而不是每个标记的不同时间和温度。我想知道如何使每个弹出窗口显示其信息。