Generate a map with a marker for any structure.

I want to basically generate a treasure map style map but instead of buried treasure I want it to point to the nearest specific structure or POI. Is this possible with datapacks and if so how would I do it or could someone make it for me?
Continue to help post