title: Displaying Information from Multiple Shapefiles in Label Leaflet R
body: <p>I am currently building a shinyapp with <code>leaflet</code> with multiple shapefile layers.
  I would like the user to be able to hover over an area and see both the name of the census tract and zip code in the tooltip. This problem is made more difficult by the fact that zip codes and census tracts do not overlap neatly.<br><br>
  The solution may require some means of finding the intersections between the two shapefiles, though I am not sure on where to begin.
  <br><br>
  Is there any way for leaflet to recognize the position of the cursor across multiple polygon layers?
  <br><br>Reprex:</p>
  <pre><code>library(shiny)
  library(leaflet)
  library(rgdal)
  
  zip_codes &lt;- read_sf(&quot;shapefiles/ZCTA-Harris/ZCTA Harris.shp&quot;)
  tracts &lt;- read_sf(&quot;shapefiles/Tracts/Tracts 2020.shp&quot;)
  
  ui &lt;- fluidPage(
    leafletOutput(outputId = &quot;map&quot;)
  )
  
  server &lt;- function(input, output, session) {
    output$map &lt;- renderLeaflet({
      leaflet()%&gt;%
        addTiles() %&gt;%
        setView(lat = 29.84, lng = -95.393462, zoom = 10)%&gt;%
        addPolygons(
          data = zip_codes,
          weight = 2,
          opacity = 1,
          color = &quot;black&quot;
        )%&gt;%
        addPolygons(
          data = tracts,
          weight = 2,
          opacity = 1,
          fillOpacity = 0,
          color = &quot;firebrick&quot;,
          label = ~name
        )
      
      
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/UadEC.jpg" rel="nofollow noreferrer">screenshot</a></p>