I am trying to take latitude and longitude values from different people's location into a gridlike 2D display where y= longitude and x = latitude 2D. How can I do that using html, css, java? I just found from a different question, maybe I could use ArcGis Api to translate the values to X and Y. But then how would I place them on the screen, so that they have the correct location?
I have this code for the latitude and longitude:
const getLocation = document.getElementById("btn");
getLocation.addEventListener("click", evt=> {
if("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(position=> {
let latitude = position.coords.latitude;
let longitude = position.coords.longitude;
console.log(latitude,longitude);
},error=>{
console.log(error.code);
});
}else {
console.log("not supported")
}
});
Via Active questions tagged javascript - Stack Overflow https://ift.tt/dvVfGw8
Comments
Post a Comment