Posts

Showing posts with the label Leaflet

Adding A Linestring By St_read In Shiny/Leaflet

Answer : Your test data is a dead link now, but I had a similar issue trying to plot sf linestrings and polygons in leaflet . The full error was Error in if (length(nms) != n || any(nms == "")) stop("'options' must be a fully named list, or have no names (NULL)") : missing value where TRUE/FALSE needed I was able to successfully plot my geometries by dropping the Z dimension from the line and polygon with st_zm . Here is an example: library(sf) library(leaflet) # create sf linestring with XYZM dimensions badLine <- st_sfc(st_linestring(matrix(1:32, 8)), st_linestring(matrix(1:8, 2))) # check metadata for badLine > head(badLine) Geometry set for 2 features geometry type: LINESTRING dimension: XYZM bbox: xmin: 1 ymin: 3 xmax: 8 ymax: 16 epsg (SRID): NA proj4string: NA LINESTRING ZM (1 9 17 25, 2 10 18 26, 3 11 19 2... LINESTRING ZM (1 3 5 7, 2 4 6 8) # attempt map; will fail > leaflet(...

Angular 2 / Leaflet Map, How To Link To A Component From Marker Popup ? ... RouterLink?

Answer : There is a very simple approach and a very complex one. The simple approach is to use raw HTML with anchor element outside of angular without RouterLink . Register to clicks on that anchor element and use the Router service to navigate. The task was to fire links but the actual problem is far deeper, now it links next time its showing an angular component... So, for the complex solution: This is an highly advanced topic... Not only it involves using advanced angular techniques it's also advanced in the leaflet implementation. I'll do my best to convey the message but due to the complexity the examples will be very simple and will require work. First - Angular realm. An HTML string that contains directives, components or pipes will never work, the only way is to initialize a View Let's define A View as a reference to view instance of a component or a template . These are called ComponentRef and TemplateRef So, we have 2 ways to solve this ...