summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/map/index.js18
-rw-r--r--site/assets/css/applets.css4
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);