diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-03-30 18:50:32 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-03-30 18:50:32 +0100 |
| commit | 9d1915af786379446ac7465215b6f3679f270e19 (patch) | |
| tree | f535514e9d6bd3b82431240ecc79738f34cc5e14 | |
| parent | 3cc021b171e72d8e290c5705804a7fbc519bdced (diff) | |
map scroll
| -rw-r--r-- | client/map/index.js | 18 | ||||
| -rw-r--r-- | site/assets/css/applets.css | 4 |
2 files changed, 18 insertions, 4 deletions
diff --git a/client/map/index.js b/client/map/index.js index a1c728d9..9ca43867 100644 --- a/client/map/index.js +++ b/client/map/index.js @@ -52,12 +52,12 @@ function addMarker(map, latlng, citations) { rec.unshift("<a href='" + doi[0] + "' target='_blank'>") rec.push("</a>") } - const addressString = addresses.map(addr => addr.name).join('<br/>') - rec.push("<br>") - rec.push(addressString) if (year) { rec.push(" (" + year + ")") } + const addressString = addresses.map(addr => addr.name).join('<br/>') + rec.push("<br>") + rec.push(addressString) return rec.join("") }) @@ -107,6 +107,7 @@ export default function append(el, payload) { console.log(citation) return } + console.log(citation) citation.addresses.forEach(address => { if (!(address.name in citationsByAddress)) { citationsByAddress[address.name] = { address, citations: []} @@ -122,7 +123,16 @@ export default function append(el, payload) { const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n)) if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return addMarker(map, latlng, citationList) - addArc(map, source, latlng, arcStyles[citationAddress.type]) + const style = { ...arcStyles[citationAddress.type] } + let weight = Math.min(citationList.length, 5) + let opacity = 0.5 + Math.min(citationList.length / 5, 0.5) + if (citationAddress.type !== 'edu') { + weight += 1 + opacity = 1 + } + style.weight = String(weight) + style.opacity = opacity + addArc(map, source, latlng, style) }) console.log(paper) diff --git a/site/assets/css/applets.css b/site/assets/css/applets.css index e5c427b2..10c0e786 100644 --- a/site/assets/css/applets.css +++ b/site/assets/css/applets.css @@ -168,6 +168,10 @@ .desktop .map_cover:hover { opacity: 1; } +.leaflet-popup-content-wrapper { + max-height: 230px; + overflow-y: auto; +} .leaflet-popup-content a { color: #0078A8; border-bottom: 1px solid rgba(0, 128, 160, 0.4); |
