Compare commits
3 commits
174ebca34b
...
5c8103e84e
Author | SHA1 | Date | |
---|---|---|---|
5c8103e84e | |||
7ce4b58dc3 | |||
35ca8414e3 |
2 changed files with 25 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
cp geofeed.csv dist
|
||||
|
||||
ncftp -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER -c "rm -r *"
|
||||
ncftp -u $FTP_USER -p $FTP_PASSWORD $FTP_SERVER -c "rmdir -r *"
|
||||
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"
|
||||
|
|
|
@ -76,6 +76,7 @@ const sidebarContent = document.getElementById("sidebarContent");
|
|||
const nodesElement = document.getElementById("nodes");
|
||||
|
||||
function dismissPopup(hideMarker) {
|
||||
console.log('dismissing')
|
||||
if (opened == null) return;
|
||||
const popup = opened[0];
|
||||
|
||||
|
@ -97,11 +98,17 @@ function dismissPopup(hideMarker) {
|
|||
}, 300);
|
||||
};
|
||||
|
||||
//map.on('popupClose', dismissPopup);
|
||||
sidebarContent.onclick = dismissPopup;
|
||||
|
||||
function onNodeClick(ev, node, clicked) {
|
||||
console.log('b')
|
||||
if (opened != null) return;
|
||||
console.log(opened)
|
||||
if (opened != null) {
|
||||
//if (ev instanceof MouseEvent) return;
|
||||
//dismissPopup();
|
||||
return;
|
||||
}
|
||||
const rect = clicked.getBoundingClientRect();
|
||||
|
||||
nodesElement.style.opacity = 0;
|
||||
|
@ -126,7 +133,7 @@ function onNodeClick(ev, node, clicked) {
|
|||
sidebarContent.style.backgroundColor = "#111";
|
||||
|
||||
opened = [ele, clicked, node];
|
||||
ev.stopPropagation();
|
||||
console.log("opened")
|
||||
}
|
||||
|
||||
for (let node of Object.values(nodes)) {
|
||||
|
@ -135,14 +142,26 @@ for (let node of Object.values(nodes)) {
|
|||
let ele = document.createElement("div");
|
||||
ele.innerHTML = `<strong>${node.city}</strong>`;
|
||||
if (node.description != '') ele.innerHTML += `<br><small>${node.description.split('\n')[0]}</small>`;
|
||||
|
||||
ele.onclick = (ev) => {
|
||||
marker.openPopup();
|
||||
map.panTo(node.location, {
|
||||
padding: [1000, 1000], // TODO I could use this to fix the small screen issue
|
||||
duration: 0.3
|
||||
});
|
||||
onNodeClick(ev, node, ele);
|
||||
//onNodeClick(ev, node, ele);
|
||||
ev.stopPropagation();
|
||||
};
|
||||
marker.on('popupopen', (ev) => {
|
||||
console.log(ev)
|
||||
console.log('popened');
|
||||
onNodeClick(ev, node, ele);
|
||||
});
|
||||
marker.on('popupclose', () => {
|
||||
console.log('closed')
|
||||
dismissPopup()
|
||||
});
|
||||
|
||||
nodesElement.appendChild(ele);
|
||||
}
|
||||
|
||||
|
@ -151,6 +170,6 @@ line(de1t, nodes.pl1.location, "de1 - pl1<br><strong>24ms</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>");
|
||||
|
||||
map.on("dragstart", function () {
|
||||
/*map.on("dragstart", function () {
|
||||
dismissPopup(false);
|
||||
});
|
||||
});*/
|
Loading…
Reference in a new issue