export function buttonCalc_click(event) { distance($w("#startingPoint").value, $w("#endPoint").value) .then(function (resp) { let distanceInMiles = parseFloat(resp.rows[0].elements[0].distance["text"], 10); distanceInMiles *= 1.00; distanceInMiles = distanceInMiles.toFixed(2); let duration = resp.rows[0].elements[0].duration["text"]; //Page code let miles = resp.rows[0].elements[0].distance["text"] // printing the result on the screen $w("#result").value = distanceInMiles; $w("#duration").value = duration; $w("#textboxMiles").value = miles; }) } //Backend file code export async function distance(origin, destination) { const secret = await wixSecretsBackend.getSecret("apiDistance"); const distanceUrl = "https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial"; const url = distanceUrl + `&origins=` + origin + `&destinations=` + destination + `&key=${secret}`; return fetch(url, { method: 'get' }) .then((httpResponse) => httpResponse.json()); }
top of page
  • Facebook
  • X
  • Instagram
stock-vector-barcode-vector-illustration-337440620.jpg

Track
Your
Package


 

It;s On
The Way

Let Us Get to Know You, become A Member Sign Up

Why become a member, we get to know you, your ship to address, when your package arrives/ we know where to ship to, you'll let us know if you're a consolidated shipper or a package shipper, in return we give you a US shipping address, it's that simple

Contact Form
bottom of page