Skip to main content

All Questions

Tagged with
1 vote
1 answer
121 views

Customize the legend of bubble map by using leaflet

So far I could plot the bubble map as below: library(leaflet) library(leafletCN) library(plyr) dat = data.frame(name = regionNames("china"), value = 1) data=data.frame(...
Robin's user avatar
  • 437
0 votes
1 answer
760 views

How to create custom legend labels in R/Leaflet when you use the pal argument in AddPolygons

I have a Leaflet map that colors polygons according to a previously defined pal function, which varies with a variable and the bins (and therefore the colors) are defined manually. Then it creates a ...
leviemb's user avatar
  • 49
0 votes
1 answer
496 views

Legend using leaflet

I create this code, it is work but when I add a legend it doesn't work well. Someone can help me? I need the legend has the same value of nycounties$dimension, also I need to reorder increase. ...
Inuraghe's user avatar
  • 580
0 votes
1 answer
693 views

Toggling Between Map Legends in Leaflet using Shiny

I am currently trying to code a leaflet legend in shiny so that the corresponding legend changes as I toggle between the maps. I have read this blog post: https://medium.com/ibm-data-ai/layer-specific-...
Luke Jenner's user avatar
3 votes
1 answer
2k views

Create Custom Labels in Leaflet Legend

Map Image I have created a map in leaflet. The legend is currently numbered 0, 2, 4, 6, 8. However, I would instead like just two labels. One saying 'Less Dense' and another saying 'More Dense'. I am ...
Luke Jenner's user avatar
0 votes
1 answer
375 views

Update to "reverse order in R leaflet continuous legend"?

I have exactly the same question as this one from 5 years ago. I want to invert the scale of a continuous color scale in a leaflet choropleth created from R. I'm hoping that there is a better answer ...
Dave Braze's user avatar
0 votes
0 answers
210 views

Issue add icon and legend with leaflet in r

I try to reduplicate the below code in r markdown, but meet: "Error in htmltools::tags$polygon(id = "diamond", points = draw_diamond(width = width, : attempt to apply non-function"....
Feixiang Sun's user avatar
3 votes
1 answer
2k views

How to show/hide legend with control layer panel with leaflet?

I am trying to plot a map with multiple layers. However, when selecting the group I want to show in the controlLayer panel, it changes the map but not the legend. In fact, the 2 legends are always ...
hitaton's user avatar
  • 163
0 votes
1 answer
1k views

Create dynamic legend on R Shiny Leaflet Maps, Error: 'colors' and 'labels' must be of the same length

I have been struggling in creating a dynamic maps legend in R shiny Leaflet Maps. The idea is to have a template code so whenever the data change, the map and its legend will follow. The coordinate is ...
Muhammad Rizki's user avatar
4 votes
0 answers
413 views

R leaflet map - combine layer group selection with the legend?

I know there are several R leaflet threads on here about showing the legend of layers only when those layers are selected using the addLayersControl command. But my questions is slightly different a ...
tfarrugia's user avatar
0 votes
1 answer
450 views

Customizing Raster Labeling in LeafLet R

I have a raster layer with cell value ranging from 1 to 68, each number representing a different land cover type. how can i do it? I tried labelformat>>> transform. So far I can only work for ...
Jing Zhang's user avatar
2 votes
1 answer
590 views

Is it posible to close / open legend or overlayGroups/legend from leaflet map R on shiny Server?

I am trying to hide OverlayGroups in R but I don't know how to that. What I am trying to do is to hide it when it is not used. If possible have a button to click it and then It will minimize overlay ...
Angel's user avatar
  • 2,645
0 votes
1 answer
1k views

Insert icon in the legend of a map generated by leaflet

I created a map with the leaflet with two databases (df and df1). I managed to insert the legend of the database df, which are points referring to the clusters that I generated. However I would like ...
Antonio's user avatar
  • 1,111
1 vote
0 answers
179 views

edit source code for leaftlet labelFormat to edit breaks/tick marks

I'm trying to edit a leaflet legend. Does anyone know how to edit the number of breaks and where to place tick-marks when using a predefined palette from colorNumeric (not colorQuantile, see here) in ...
user63230's user avatar
  • 4,447
0 votes
1 answer
392 views

The legend colors are not perfectly similar to color of polygons

I am using the leaflet function to create an interactive map within the shiny framework. Everything looks great except the legend. The colors of the legend are somewhat faded and therefore not ...
Nader Mehri's user avatar

15 30 50 per page