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

SpatialLines with MultiLines are not all shown #18

Closed
edzer opened this issue Mar 3, 2016 · 5 comments
Closed

SpatialLines with MultiLines are not all shown #18

edzer opened this issue Mar 3, 2016 · 5 comments

Comments

@edzer
Copy link
Member

edzer commented Mar 3, 2016

Try:

library(trajectories)
data(storms)
x = as(storms, "SpatialLinesDataFrame")
plot(x)
library(mapview)
mapview(x)

it seems that only the first Line of a Lines object is plotted.

@fdetsch
Copy link
Collaborator

fdetsch commented Mar 3, 2016

The problem is obviously related with addPolylines from leaflet that seemingly drops all but the first continuous sub-line in an otherwise discontinuous (i.e., segmented) line. For example,

leaflet(x) %>% addTiles() %>% addPolylines()

behaves similar to mapview(x). I implemented a temporary workaround to display all line segments regardless of whether or not the line is broken. Edzer, since I assume you are familiar with the storms dataset, could you please compile the latest version of the 'devel' branch (1.0.11) and evaluate if the output of mapview(x), particularly the pop-up assignment, now looks correct? Please note that this currently works with burst = FALSE only.

@edzer
Copy link
Member Author

edzer commented Mar 3, 2016

Thanks! For SpatialLinesDataFrame it now works, for SpatialLines it doesn't. Shall I write an issue for leaflet?

@fdetsch
Copy link
Collaborator

fdetsch commented Mar 3, 2016

It shouldn't cost too much effort to transfer this approach to SpatialLines. Since the problem arises from addPolylines, however, I think that it would be desirable if this could be handled from the leaflet side in the long run (not least because there are far more leaflet users out there).

@edzer
Copy link
Member Author

edzer commented Mar 3, 2016

It's already there: rstudio/leaflet#213

@edzer edzer closed this as completed Mar 3, 2016
@fdetsch
Copy link
Collaborator

fdetsch commented Mar 3, 2016

Just for the record, mapview support for SpatialLines is now enabled as well.

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