I have a dash app with a mapbox plot in it. My app reads in a shapefile geometry column and then plots the polygons (corresponding to regions in Australia) onto the mapbox plot as a layer. It can also read in a latitude and longitude column and plot those point on the same map (as a trace).
My problem is that I want the polygons to be hoverable, so that when I hover over them (like I would with the lat/long data in the trace) I get some extra information. I found a way to do this by calculating the lat/long centroid of each polygon and plotting those as a separate data trace with opacity 0, but this is a bit hacky and results in some loss of functionality further down the road. Is there any other way to get some polygons with hover data? It would be great if I could display them through a trace rather than an added layer.
I can give more information if necessary, but I am trying to keep the question simple.