marinebon / p2p

Pole to Pole website
https://marinebon.github.io/p2p
3 stars 1 forks source link

MBON Pole to Pole site list added #1

Closed eqmh closed 6 years ago

eqmh commented 6 years ago

Hello Ben,

I just uploaded a csv with lat/lons of P2P sites. I would like to show these on the home page map and have them being interactive with the features we talked about on these notes. There are more detailed notes on app functionalities in these other notes about how we can display temperature logger data and other things like data sheet conversion to CSV using Google Vision API for OCR, and other stuff.

Let me know if you prefer a different format. Cheers, Enrique

7yl4r commented 6 years ago

Similar older discussion about the infographics here.

Using leaflet with this csv shouldn't be very different.

eqmh commented 6 years ago

I am trying to add markers on the map using:

addMarkers(
    lng = -64.8830, 
    lat = -42.8000, 
    popup = ~as.character(mag), 
    label = ~as.character(mag)
)

I'm getting this error:

Error in getMapData(map) : argument "map" is missing, with no default Calls: ... eval -> addPolygons -> derivePolygons -> getMapData

Is this familiar?

7yl4r commented 6 years ago

I had no luck finding anything related. All the examples I see from leaflet's docs on markers pass in a dataframe using R's pipe operator (%>%). My guess would be that leaflet needs to do some initialization first? Maybe add a leaflet() above that?

Something you could do to help us debug would be to push this code into github on a branch or fork (your choice but branch will be easier I think). Good info here but the gist would be:

# create branch named p2pmap:
git branch p2pmap  

# switch over to that branch on your local
git checkout p2pmap

# add, commit, push on the p2pmap branch
git add file.txt  
git commit -m "attempt addMarkers; getMapData error"
git push origin p2pmap

use git checkout to switch back to the master branch when you are ready.

bbest commented 6 years ago

Hey @eqmh,

So I added the site markers to the homepage map:

image

Here's a few things worthy of note:

eqmh commented 6 years ago

Thanks, @7yl4r !

I suppose that any changes made to sites.csv will be shown of the map makers, right? I will change the site names on this file.

bbest commented 6 years ago

Hey @eqmh,

Yes, you can update the name values in data/sites.csv, then knit index.Rmd, git commit & push.

Cheers, @bbest

eqmh commented 6 years ago

Sorry, @bbest, I just realized that you made these changes. Thanks to you! Cheers, @eqmh