Hide and show labels by default in maps

0 votes
Hey! I need to show labels for certain branches in the map. How to add default show a label or hide a label in map?

Please help!! Thanks.
Sep 23 in Data Analytics by anonymous
• 3,290 points
12 views

1 answer to this question.

0 votes

Hi,

You need to just add an attribute to enable labels to be visible always on the map by adding below ode within addMarkers( ).

labelOptions = labelOptions(noHide = T)

Example-

leaflet() %>% addTiles() %>% addCircleMarkers(lng=77.6944, lat=12.9811,label = "My Office",color = "red",labelOptions = labelOptions(noHide = T))

You can also add CSS to change the font size, direction, styling using style attribute within labeloptions( ).

Hope it helps!

answered Sep 23 by Cherukuri
• 31,840 points

Related Questions In Data Analytics

0 votes
0 answers

how to hide and show legends for different geom_plots* in a single ggplot?

how to hide and show legends for ...READ MORE

Jul 23 in Data Analytics by karthick
23 views
0 votes
1 answer

How can I add x and y axis labels in ggplot2 ?

# Load a dataset(to work with) # We’ll ...READ MORE

answered May 16, 2018 in Data Analytics by zombie
• 3,690 points
132 views
0 votes
0 answers

Show null and not null value in fields in bar chart

My data consists of feedback from students ...READ MORE

Aug 2 in Data Analytics by radha
13 views
0 votes
1 answer

How to hide/show tabs in shiny app in R?

Hi, Radha One way is to use hidetab ...READ MORE

answered Aug 21 in Data Analytics by anonymous
• 31,840 points
166 views
0 votes
1 answer

Pop up always visible without clicking on the marker in leaflet

@Ch, Pop-up cannot be enabled by default. Another ...READ MORE

answered Sep 23 in Data Analytics by Cherukuri
• 31,840 points
19 views
0 votes
1 answer

plot map points from a dataframe

Hi Peter, Use below code. leaflet(df) %>% addTiles() %>% ...READ MORE

answered Sep 17 in Data Analytics by priya
17 views
0 votes
1 answer

How to add external markers in maps?

Use external markers by creating icons using ...READ MORE

answered Oct 14 in Data Analytics by Cherukuri
• 31,840 points
17 views
0 votes
1 answer

How to add legend or any text on the map in leaflet?

See below example, > p = colorFactor(palette = ...READ MORE

answered Oct 28 in Data Analytics by anonymous
• 31,840 points
29 views
0 votes
2 answers

Change the default order of labels of factor in R

You can also use relevel() to change ...READ MORE

answered Jun 27 in Data Analytics by sindhu
40 views
0 votes
1 answer