Diskussionen » Entwicklungsanfragen

Adding a map to Indeed / Linkedin job board posts?

§
Veröffentlicht: 13.08.2023

Hi all,

I'm looking to see if there is a script that will add to job postings as they already have a location and sometimes a zipcode too. Trying to get an idea of where the job is by showing the general area of where the location is within the state via google maps. Trying to speed up the job searching process.

Thanks!

§
Veröffentlicht: 15.08.2023
Bearbeitet: 15.08.2023

This is the concept for indeed, but I won't do it for you

const companyInfoElements = document.querySelectorAll(".companyInfo");

companyInfoElements.forEach((companyInfo, i) => {
const companyName = companyInfo.querySelector(".companyName").textContent;
const companyLocation = companyInfo.querySelector(".companyLocation").textContent;

const googleMapsUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(companyLocation)}`;

const iframe = document.createElement("iframe");
iframe.setAttribute("src", googleMapsUrl);
iframe.setAttribute("width", "300");
iframe.setAttribute("height", "200");
iframe.style.position = "absolute";
iframe.style.display = "none";

document.querySelectorAll("li")[i].addEventListener("mouseenter", () => {
iframe.style.display = "block";
});

document.querySelectorAll("li")[i].addEventListener("mouseleave", () => {
iframe.style.display = "none";
});

document.querySelectorAll("li")[i].appendChild(iframe);
});

Antwort schreiben

Anmelden um eine Antwort zu senden.