Change color of leafpm-layer

96 Views Asked by At

Can I change the default color of an object added to a leaflet map by the leafpm-package? The default color is blue, which I would like to have in red. I managed to get the lines red (see below) until the shape is finished. However, I'm lacking a "lineStyle" or color- argument for the default (NULL)-layer.

I know, I can specify a layer to edit through the targetLayerId = NULL, targetGroup = NULL options in addPmToolbar(). But while I was able to edit a given layer with given color properties, any shapes I added remained in the default blue.

pacman::p_load(dplyr, leafpm, leaflet)
leaflet() %>%
  addTiles() %>%
  addPmToolbar(
    toolbarOptions = pmToolbarOptions(drawMarker = FALSE, drawPolygon = F,drawRectangle = F,drawCircle = F, position = "topright", 
                                      editMode = TRUE, cutPolygon = F, removalMode = T),
    drawOptions = pmDrawOptions(snappable = T, allowSelfIntersection = T,finishOn = "dblclick",
                                templineStyle =list(color = "red")),
    editOptions = pmEditOptions(preventMarkerRemoval = F, draggable = FALSE),
    cutOptions = pmCutOptions(snappable = FALSE, allowSelfIntersection = FALSE)
  )
0

There are 0 best solutions below