1

I am trying to plot a path from a dataframe of lat lon coordinates. The data can be found here. This is the code I am using for plotting the path:

library(sf)
library(mapdeck)
library(tidyverse)

df1 <- df %>% st_as_sf(coords = c("lon", "lat")) %>% 
  group_by(imoNumber) %>%summarise(m=mean(imoNumber, na.rm = TRUE)) %>% st_cast("LINESTRING")
mapdeck(token = key, style = mapdeck_style("outdoors")) %>% 
  add_path(data = df1)

This plots the data like this:

enter image description here

Is there some way of adding arrow heads to show the direction of the path? Something akin to polyline decorator in leaflet? Desired result is something like this:

enter image description here

zx8754
  • 52,746
  • 12
  • 114
  • 209
Dhiraj
  • 1,650
  • 1
  • 18
  • 44
  • This is not currently possible in mapdeck. – SymbolixAU Mar 23 '19 at 20:39
  • @SymbolixAU would be nice if you could add this whenever time permits. In the interim, do you have any suggestion for overcoming the problem of loading a very large number of line segments in leaflet in a Shiny app? That's why I was looking at mapdeck, but now can't because of the path direction problem. – Dhiraj Mar 24 '19 at 04:28
  • If you can convince the [deck.gl](https://github.com/uber/deck.gl) developers to add it as a feature then I'll be able to add it in to mapdeck quite easily. But at the moment I'm unlikely to get round to doing this myself – SymbolixAU Mar 24 '19 at 21:16
  • 2
    I've added this to my issue tracker as a feature request - https://github.com/SymbolixAU/mapdeck/issues/146 , but, I won't be working on it anytime soon – SymbolixAU Mar 26 '19 at 22:02
  • @SymbolixAU thanks, will wait for this feature. – Dhiraj Mar 27 '19 at 13:09
  • not arrow heads, but you can now use dashed lines - example on [twitter](https://twitter.com/_davecooley/status/1172770171804479488) – SymbolixAU Sep 15 '19 at 09:26

0 Answers0