Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapboxer extras #66

Open
Camil88 opened this issue Mar 20, 2021 · 3 comments
Open

Mapboxer extras #66

Camil88 opened this issue Mar 20, 2021 · 3 comments

Comments

@Camil88
Copy link

Camil88 commented Mar 20, 2021

Hello, I would like to manually draw a polygon on a map. I've been searching for such an option in mapboxer but couldn't find. I would also like to manually draw an area on a map which selects points (coordinates) and e.g. calculate some statistics for the points instantly. In general, I'd like to use options available in package leaflet.extras. Please take a look here for working example: https://gist.github.com/mndrake/aee9a0f5c53018860e46766d0131cd29

My question is if it's possible to mix mapboxer with leaflet.extras to use all options available there? Or maybe mapboxer can't be mixed in any way with leaflet functions?

@crazycapivara
Copy link
Owner

@Camil88 leaflet and mapbox are two different libraries, so you cannot use the leaflet plugins in mapbox. Here you can see some available mapbox plugins, but they need to be bind to R aswell. That is what the leaflet.extras package does for some leaflet plugins. The drawControl is already included in mapboxer, so you can use add_draw_control to draw polygons onto the map. Unfortunately I did implement sending data back to R (Shiny), so that you can use it in your app to check whether some points are within the polygon. But that is not a big issue. Furthermore, I already added some plugins that are only available in mapboxer like add_filter_control, see also here.

@crazycapivara
Copy link
Owner

#67

@Camil88
Copy link
Author

Camil88 commented Mar 22, 2021

Ok, thank you for your explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants