我刚刚注意到,当应用任何格式时,Leaflet Shiny中的弹出窗口不会更新。当我使用时:
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)
带斜体或粗体的线在地图上具有相同的值,而如果我跳过em / strong标签,则每条线都具有正确的唯一值。所有其他弹出值(未格式化)都表现正确 - 每个标签都包含数据中的内容。你碰巧知道为什么会这样吗?我想格式化弹出窗口,没有它就可以生活,但是不能用机器打败我;)
答案 0 :(得分:2)
我添加了一个额外的粘贴功能,并更改为更多的HTML代码。这应该工作。我用我的数据在我的机器上运行它并且它有效,但我没有你的数据集,所以你可能需要稍微操纵()。如果您发布数据集,我们可以共同努力使其顺利运行。
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)))