3
votes

I have just noticed that the popups in Leaflet Shiny do not update when any formatting is applied. When i am using:

addMarkers(points1$Lon,points1$Lat 
,popup= paste(sep = "<br/>",
strong(points1$Suspension_ID), 
 paste(points1$Street,points1$Zone), points1$Reason, 
paste(points1$Bay_Type, "-" , points1$Spaces, "Space(s)"),   
em(points1$Location),
paste(points1$Start_Date, " TO ", points1$End_Date), points1$Time_Details)

the lines with italics or bold have the same value across the map, while if i skip the em/strong tags every line has correct unique value. All other popup values (not formatted) behave correctly - every label contains what is in the data. Do you happen to know why would it be so? I wanted to format the popups, can live without it, but cannot live with a machine outsmarting me;)

1

1 Answers

2
votes

I added an additional paste function and changed to a more html code. This should work. I ran it on my machine with my data and it worked, but I don't have you're data set, so you might have to maneuver the () a bit. If you post your data set we can together work to get it running smoothly.

addMarkers(points1$Lon,points1$Lat ,popup= paste(paste(
"<strong>", points1$Suspension_ID, "</strong>"), 
paste(points1$Street,points1$Zone, points1$Reason), 
paste(points1$Bay_Type, "-" , points1$Spaces, "Space(s)"),   
paste("<em>", points1$Location, "</em>"),
paste(points1$Start_Date, " TO ", points1$End_Date, points1$Time_Details)))