'Pass data from one window to another in React
Hello everyone I have the following code to take the location I need to use those values to send them to another page or component if someone could help me it would be very useful greetings
const processManualLocation = () => {
const url = `https://www.googleapis.com/geolocation/v1/geolocate?key=.........`;
const http = new XMLHttpRequest();
http.open("POST", url);
http.onreadystatechange = function(){
if(this.readyState == 4 && this.status == 200){
let resultado = JSON.parse(this.responseText);
let latitude = resultado.location.lat;
let longitude = resultado.location.lng;
console.log(latitude, longitude);
}
}
http.send();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
