Closed eqmh closed 6 years ago
Similar older discussion about the infographics here.
Using leaflet with this csv shouldn't be very different.
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?
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.
Hey @eqmh,
So I added the site markers to the homepage map:
Here's a few things worthy of note:
docs/
since it gets wiped clean before rebuilding the website in its placedocs/MBON_Pole-to-Pole_sites.csv
should be outside docs/
, like now in data/sites.csv
index.Rmd
:
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.
Hey @eqmh,
Yes, you can update the name
values in data/sites.csv
, then knit index.Rmd
, git commit & push.
Cheers, @bbest
Sorry, @bbest, I just realized that you made these changes. Thanks to you! Cheers, @eqmh
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