Compare commits

..

No commits in common. "5c8103e84e8bb70b01f677d6888e743ac6fd8568" and "174ebca34b9875a970d9abd7596600d406284f2c" have entirely different histories.

2 changed files with 6 additions and 25 deletions

View file

@ -2,7 +2,7 @@
cp geofeed.csv dist cp geofeed.csv dist
ncftp -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER -c "rmdir -r *" ncftp -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER -c "rm -r *"
ncftpput -R -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER . dist/* ncftpput -R -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER . dist/*
curl -H "AccessKey: $ACCESS_KEY" "https://api.bunny.net/purge?url=https%3A%2F%2Fdn42.m724.eu&async=false" curl -H "AccessKey: $ACCESS_KEY" "https://api.bunny.net/purge?url=https%3A%2F%2Fdn42.m724.eu&async=false"

View file

@ -76,7 +76,6 @@ const sidebarContent = document.getElementById("sidebarContent");
const nodesElement = document.getElementById("nodes"); const nodesElement = document.getElementById("nodes");
function dismissPopup(hideMarker) { function dismissPopup(hideMarker) {
console.log('dismissing')
if (opened == null) return; if (opened == null) return;
const popup = opened[0]; const popup = opened[0];
@ -98,17 +97,11 @@ function dismissPopup(hideMarker) {
}, 300); }, 300);
}; };
//map.on('popupClose', dismissPopup);
sidebarContent.onclick = dismissPopup; sidebarContent.onclick = dismissPopup;
function onNodeClick(ev, node, clicked) { function onNodeClick(ev, node, clicked) {
console.log('b') console.log('b')
console.log(opened) if (opened != null) return;
if (opened != null) {
//if (ev instanceof MouseEvent) return;
//dismissPopup();
return;
}
const rect = clicked.getBoundingClientRect(); const rect = clicked.getBoundingClientRect();
nodesElement.style.opacity = 0; nodesElement.style.opacity = 0;
@ -133,7 +126,7 @@ function onNodeClick(ev, node, clicked) {
sidebarContent.style.backgroundColor = "#111"; sidebarContent.style.backgroundColor = "#111";
opened = [ele, clicked, node]; opened = [ele, clicked, node];
console.log("opened") ev.stopPropagation();
} }
for (let node of Object.values(nodes)) { for (let node of Object.values(nodes)) {
@ -142,26 +135,14 @@ for (let node of Object.values(nodes)) {
let ele = document.createElement("div"); let ele = document.createElement("div");
ele.innerHTML = `<strong>${node.city}</strong>`; ele.innerHTML = `<strong>${node.city}</strong>`;
if (node.description != '') ele.innerHTML += `<br><small>${node.description.split('\n')[0]}</small>`; if (node.description != '') ele.innerHTML += `<br><small>${node.description.split('\n')[0]}</small>`;
ele.onclick = (ev) => { ele.onclick = (ev) => {
marker.openPopup(); marker.openPopup();
map.panTo(node.location, { map.panTo(node.location, {
padding: [1000, 1000], // TODO I could use this to fix the small screen issue padding: [1000, 1000], // TODO I could use this to fix the small screen issue
duration: 0.3 duration: 0.3
}); });
//onNodeClick(ev, node, ele);
ev.stopPropagation();
};
marker.on('popupopen', (ev) => {
console.log(ev)
console.log('popened');
onNodeClick(ev, node, ele); onNodeClick(ev, node, ele);
}); };
marker.on('popupclose', () => {
console.log('closed')
dismissPopup()
});
nodesElement.appendChild(ele); nodesElement.appendChild(ele);
} }
@ -170,6 +151,6 @@ line(de1t, nodes.pl1.location, "de1 - pl1<br><strong>24ms</strong>");
line(de1t, nodes.nl1.location, "de1 - nl1<br><strong>10ms</strong>"); line(de1t, nodes.nl1.location, "de1 - nl1<br><strong>10ms</strong>");
line(nodes.nl1.location, nodes.it1.location, "it1 - nl1<br><strong>25ms</strong>"); line(nodes.nl1.location, nodes.it1.location, "it1 - nl1<br><strong>25ms</strong>");
/*map.on("dragstart", function () { map.on("dragstart", function () {
dismissPopup(false); dismissPopup(false);
});*/ });