diff --git a/src/vis/MeasurementMap.tsx b/src/vis/MeasurementMap.tsx index ac91de1..170c257 100644 --- a/src/vis/MeasurementMap.tsx +++ b/src/vis/MeasurementMap.tsx @@ -67,8 +67,8 @@ function searchEventHandler(result: any): void { + "&street_number=" + parsedAddr.street + "&st=" + parsedAddr.type + "&post_direction=" + post_direction - + "&zip_5=" + postcode; - // + "&zip_9=" + "3207"; + + "&zip_5=" + postcode + + "&zip_9=" + "3207"; console.log(url); @@ -80,7 +80,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)); + result.marker.setPopupContent(organizePopup(xhr.responseText, postcode)); } }; xhr.send(); @@ -89,9 +89,9 @@ function searchEventHandler(result: any): void { // organize popup content. called from searchEvenHandler -function organizePopup(apiText: any): string{ +function organizePopup(apiText: any, postcode: any): string{ let dict = JSON.parse(apiText); - //console.log(dict); + console.log(dict); let returnString = "
" + "Provider" + " | " @@ -102,11 +102,11 @@ function organizePopup(apiText: any): string{ if ("message" in dict) { return dict["message"]; } - let dict2 = dict["here you go"]; - console.log(dict2); + //let dict2 = dict["here you go"]; + //console.log(dict2); // for loop that goes over each key in dictionary - for (let key in dict2) { + for (let key in dict) { /*returnString = returnString + "" + key + "" + ": Available speeds up to " + dict2[key]["Available speeds"] + ", Starting at " + dict2[key]["Starting at"] + "||||
---|---|---|---|---|
" + keyName + " | " - + "" + dict2[key]["Available speeds"] + " | " - + "" + dict2[key]["Starting at"] + " | " + + "" + dict[key]["Available speeds"] + " | " + + "" + dict[key]["Starting at"] + " | " + "
"+ "Disclaimer: The table above shows a general estimate of the rates and providers in your area, using information from these sources: "
+ + "
" + "allconnect.com"
+ + "
" + "FCC National Broadband Map."
+ + "