mapboxer | An R Interface to Mapbox GL JS | Graphics library
kandi X-RAY | mapboxer Summary
kandi X-RAY | mapboxer Summary
mapboxer makes Mapbox GL JS, an open source JavaScript library that uses WebGL to render interactive maps, available within R via the htmlwidgets package.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mapboxer
mapboxer Key Features
mapboxer Examples and Code Snippets
library(mapboxer)
map <- motor_vehicle_collisions_nyc %>%
dplyr::mutate(
color = ifelse(injured == 0, "yellow", "red")
) %>%
as_mapbox_source() %>%
mapboxer(
center = c(-73.9165, 40.7114),
zoom = 10
) %>%
add_n
install.packages("mapboxer")
# install.packages("remotes")
remotes::install_github("crazycapivara/mapboxer")
Community Discussions
Trending Discussions on mapboxer
QUESTION
In my example I need to access leaflet
map from module 2 (nested) and use input$
on a map to return polygon coordinates. It works perfectly when I do this in my main module (module 1) where I can freely refer to 'map'. Unfortunately, when I pass map to another module (module 2) then the same trick with input$
doesn't work at all. Do you know how to solve it?
Here is the reproducible example. Please draw rectangle on a map and see that no coordinates are returned to the text area. But if you uncomment my gray code (in module 1) then you will see all works fine.
...ANSWER
Answered 2021-Apr-28 at 20:14When you use this kind of modularization, input, output and sessions module parameters are subsets of main input/output/session that correspond to the namespace created from module id (the NS function). If you create an input named dummy in a module whose id is foo then what is really created is an input named foo-dummy. So in the foo module you get as input all inputs having names starting with "foo-" and similarly all outputs starting with "foo-".
QUESTION
I want to refer to the namespace ns("map")
from second server module mod_btn_server2
. This module is nested in first server module mod_btn_server1
. When I click 'Button 2' points should show up on a map but they didn't. Is it possible at all to refer to "map"
from nested module?
Here's working example:
...ANSWER
Answered 2021-Mar-24 at 20:50As I mentioned in my comment above, the canonical way would be to capture the button push as an output of module moduleServer2
and use this as an input for test-btn
where you perform the action.
However, if you want to mess around with the namespaces by yourself (not recommended), you can use the following solution. I had to adapt the leafletProxy
function, because the normal implementation automatically adds the namespace of the calling module. This is what you don't want, because you want to use the namespace of a different module.
Now with code adapted to the edit:
QUESTION
For some reason I need to nest modules. I passed button to nested module mod_coordinates_server
but when I click the button points do not show up on the map. I used here reactive
and button is passed correctly - when you uncomment print(btn())
(in observeEvent
) you'll see that values are returned to console properly. It means that button works corectly. So why it doesn't work for points? Is it something wrong with namespace?
Below working example:
...ANSWER
Answered 2021-Mar-20 at 18:05Call the second module also in the main app. Try this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mapboxer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page