Skip to content

Commit

Permalink
Add google maps
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewCopeland committed Sep 6, 2023
1 parent 2661134 commit 5c1b1db
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@
let cell = document.createElement("th")
cell.innerText = value
return cell
}
}

const createForadexGoogleMapsCall = (long, lat) => {
let cell = document.createElement("th")
let link = document.createElement("a")
link.href = `https://www.google.com/maps/search/?api=1&query=${lat},${long}`
link.innerText = "Map"
console.log("google query: " + link.href)
cell.appendChild(link)
return cell
}

const createForadexRow = (find) => {
let row = document.createElement("tr")
Expand All @@ -74,6 +84,7 @@
row.appendChild(createForadexCell(find.type))
row.appendChild(createForadexCell(find.locationLong))
row.appendChild(createForadexCell(find.locationLat))
row.appendChild(createForadexGoogleMapsCall(find.locationLong, find.locationLat))
return row
}

Expand Down Expand Up @@ -276,6 +287,7 @@ <h1>My Foradex</h1>
<th>Type</th>
<th>Longitude</th>
<th>Latitude</th>
<th>Google Maps</th>
</tr>
</thead>
<tbody id="foradex-table-body">
Expand Down

0 comments on commit 5c1b1db

Please sign in to comment.