I am making an rMarkdown flex dashboard interactive html page which we will embed into another page (an iFrame). There are two small maps side by side. The maps themselves, the content, scales, legend popup are properly formatted for our purposes.
However, when the popup is activated on the left side of the map (where the legend is) it opens up behind the legend. I have adjusted the legend opacity some...but it is not enough to make the popup useful when the collide. Lowering it more will make discerning the colors in the scales difficult, watering down the interpretability of the legend. The map does continue to the right, it was just not meaningful content.
I am hoping for one of three ways to fix the situation.
1. direct the popup to open in front of the legend
2. set the legend background to complete transparency, while leaving the legends values and bin colors at opacity of 1
3. creating a fixed location in the upper right corner where the popup opens when activated so that they never conflict.
However I am completely open to any other suggestions which might be useful. The one thing that I cannot do is change the overall width of the figures they are in because they need to fit in a predetermined "box" of a set size. And they need to be side-by-side.
map<-leaflet(width ="100%")%>%
setView(lat=43.9625, lng = -72.5506, zoom = 7)%>%
addProviderTiles("CartoDB.Positron")%>%
addPolygons(data = plot2010,
fillColor = ~pal(plot2010@data$per100K),
smoothFactor = 0.2,
fillOpacity = 0.8,
weight = 0.2,
popup=popContent,
popupOptions= popupOptions(maxWidth ="100%", closeOnClick = TRUE))%>%
addLegend(position="topleft",
pal=pal,
values= plot2010@data$per100K,
title ='Age Adjusted Rates </br> per 100,000',
na.label = "Not Available",
opacity=.5,
labFormat = labelFormat(digits=1))
map