Skip to content

Commit

Permalink
update FCC link to direct to FCC page based on inputted address
Browse files Browse the repository at this point in the history
  • Loading branch information
mmt456 committed Jun 14, 2024
1 parent 2ed784a commit 4745dd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/vis/MeasurementMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ function searchEventHandler(result: any): void {
post_direction = parsedAddr.prefix;
}

var lon = result.location.raw.lon;
var lat = result.location.raw.lat;
console.log(lon);
console.log(lat);

var postcode = result.location.raw.address.postcode;
var state = result.location.raw.address.state;
var endPoint = "http://127.0.0.1:8000/"; // server
Expand All @@ -80,7 +85,7 @@ function searchEventHandler(result: any): void {
console.log(xhr.status);
if (xhr.status === 200) {
//result.marker.setPopupContent(xhr.responseText);
result.marker.setPopupContent(organizePopup(xhr.responseText, postcode));
result.marker.setPopupContent(organizePopup(xhr.responseText, postcode, lon, lat));
}
};
xhr.send();
Expand All @@ -89,7 +94,7 @@ function searchEventHandler(result: any): void {


// organize popup content. called from searchEvenHandler
function organizePopup(apiText: any, postcode: any): string{
function organizePopup(apiText: any, postcode: any, lon: any, lat: any): string{
let dict = JSON.parse(apiText);
console.log(dict);
let returnString = "<table style='border:1px solid black;'>"
Expand Down Expand Up @@ -125,7 +130,7 @@ function organizePopup(apiText: any, postcode: any): string{
returnString = returnString + "</table>";
returnString = returnString + "<p>"+ "Disclaimer: The table above shows a general estimate of the rates and providers in your area, using information from these sources: "
+ "<br />" + "<a href='https://www.allconnect.com/results/providers?zip=" + postcode + "'>allconnect.com</a>"
+ "<br />" + "<a href='https://broadbandmap.fcc.gov/home'>FCC National Broadband Map.</a>"
+ "<br />" + "<a href='https://broadbandmap.fcc.gov/location-summary/fixed?lon=" + lon + "&lat=" + lat + "'>FCC National Broadband Map.</a>"
+ "</p>";
return returnString;
}
Expand Down

0 comments on commit 4745dd9

Please sign in to comment.