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
• 1,470 points
8 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
• 26,880 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
21 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
124 views
0 votes
0 answers
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
10 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
• 26,880 points
10 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
14 views
0 votes
0 answers

How to add external markers in maps?

How to add external markers in maps? READ MORE

Sep 17 in Data Analytics by ruchitha
13 views
0 votes
0 answers

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

I'm new to leaflet and working on ...READ MORE

Sep 18 in Data Analytics by anonymous
• 26,880 points
17 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
35 views
0 votes
1 answer