map = {
const container = html`<div style="height: 500px;">`;
yield container;
const scene = new L7.Scene({
id: container,
map: new L7.Mapbox({
center: [114.23,22.3401469],
zoom: 0,
maxZoom:20,
style: "normal"
})
});
const colors = [
'#732200',
'#CC3D00',
'#FF6619',
'#FF9466',
'#FFC1A6',
'#FCE2D7',
'#ffffff',
].reverse();
scene.on("loaded", () => {
const pointLayer = new L7.PointLayer({
autoFit:true
})
.source(data)
.shape('circle')
.size(5)
.active(true)
.color('red')
.style({
opacity: 0.3,
strokeWidth: 2
});
scene.addLayer(pointLayer);
pointLayer.on('mousemove', e => {
const popup = new L7.Popup({
offsets: [ 0, 0 ],
closeButton: false
})
.setLnglat(e.lngLat)
.setHTML(`<span>${e.feature.properties.大廈名單}: ${e.feature.properties.相關確診個案}</span>`);
scene.addPopup(popup);
});
});
}