function fixW2DCButtons() {
document.querySelectorAll(".w2dc-show-on-map").forEach(function(btn) {
let listing = btn.closest(".w2dc-listing-location");
if (!listing) return;
let link = listing.querySelector("h2 a");
if (!link || !link.href) return;
// Create real link
let newLink = document.createElement("a");
newLink.href = link.href;
newLink.className = btn.className;
newLink.textContent = "View";
// Replace button completely
btn.replaceWith(newLink);
});
}
// run on load
document.addEventListener("DOMContentLoaded", fixW2DCButtons);
// run again for AJAX loaded maps
const observer = new MutationObserver(fixW2DCButtons);
observer.observe(document.body, { childList: true, subtree: true });