NCEAS / sasap-training

Training agendas and materials for open science tools for SASAP
https://nceas.github.io/sasap-training
8 stars 6 forks source link

Markers not showing up on final map in Chapter 11 #22

Closed jkibele closed 6 years ago

jkibele commented 6 years ago

When built locally, it works fine and the markers show up. ...but, on the travis built version, the markers don't show up. This is especially strange because, as indicated by the tabular outputs, the data are being read in.

I had changed the line of code that reads in the data. I changed it to read the data locally rather than directly from KNB. Then I added back the original line as an option, but that line's not evaluated.

I may switch which line is evaluated, but I really don't think that should make any difference. I'm at a bit of a loss.

amoeba commented 6 years ago

Hey @jkibele this is understandably a weird one to debug. One super useful thing about RMarkdown rendering out to HTML is that I could look at the source to the page to see where the error popped up. I inspected the map element on the page and saw that Leaflet.js was receiving the marker coordinates so I assumed there was nothing wrong with the data. I then looked at the Network panel in the Chrome devtools and saw that the requests to grab the images used to render the markers was failing.

Chrome is blocking the request to the marker images, such as https://cdn.leafletjs.com/leaflet/v1.3.1/images/marker-icon-2x.png probably because their tls certificate is invalid (at least as far as Chrome considers certificates invalid).

This is probably an issue with Leaflet's CDN so I'll look to see if we can avoid the external network request to the marker image (possibly by base64 encoding the images directly into the page).

amoeba commented 6 years ago

Looks good to me now @jkibele. I decided to just use another CDN because I like whack-a-mole but didn't feel like in-lining the images in the repo. It'd be a quick fix to use local marker icons.

jkibele commented 6 years ago

Thanks Bryce! I wasn't looking forward to trying to figure this out later today. You saved me. I owe you a beer!

jkibele commented 6 years ago

Upon further consideration, I went back, rearranged a bit, added some explanation, and un-hid your fix @amoeba. I realized (and verified) that since the point is for people to publish to github pages, they'd have the same problem. Here's the commit. Not sure why I feel compelled to document this both in the commit and on this closed issue. ...it's probably the NyQuill starting to hit.

amoeba commented 6 years ago

Sounds good. At some point in the future, leaflets default CDN should get fixed and be okay with chrome so the workaround won't be necessary whenever that happens. 👌 On Thu, May 17, 2018 at 10:00 PM Jared Kibele notifications@github.com wrote:

Upon further consideration, I went back, rearranged a bit, added some explanation, and un-hid your fix @amoeba https://github.com/amoeba. I realized (and verified) that since the point is for people to publish to github pages, they'd have the same problem. Here https://github.com/NCEAS/sasap-training/commit/7adaba52019631f9df72f20cc09ad3a509bdf4ef's the commit. Not sure why I feel compelled to document this both in the commit and on this closed issue. ...it's probably the cold NyQuill starting to hit.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/NCEAS/sasap-training/issues/22#issuecomment-390103075, or mute the thread https://github.com/notifications/unsubscribe-auth/AAACM3hPgBnc1x4Zyugw7KZnSXtEc8Kkks5tzmNwgaJpZM4UDbAt .