I want something like below image:(我想要下图所示的内容:)
Don't know where to define linestring.(不知道在哪里定义线串。) It would be great if anyone can guide me.(如果有人可以指导我,那就太好了。) Moreover I want to change the color of linestring.(此外,我想更改线串的颜色。) Here is my code:-(这是我的代码:)
function createRealtimeLayer(url, container) {
return L.realtime(url, {
interval: 5 * 1000,
getFeatureId: function(f) {
return f.properties.id;
},
cache: true,
container: container,
onEachFeature(f, l) {
date = f.properties.date;
l.bindPopup(date);
l.on("mouseover", function () {
l.openPopup();
});
l.on("mouseout", function () {
l.closePopup();
});
}
});
}
realtime1 = createRealtimeLayer('getPosition').addTo(map),
realtime2 = createRealtimeLayer('getUserPositionHistory').addTo(map);
L.control.layers(null, {
'Current': realtime1,
'History': realtime2
}).addTo(map);
realtime1.once('update', function() {
map.fitBounds(realtime1.getBounds(), {maxZoom: 18});
});
ask by Alia Jain translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…