🔒 Closed HTML & Javascript - Paano mapapa improve ang current location ng user

Status
Not open for further replies.

1nn0c3ntv5

Fanatic
Yung web app na kailangan kong gawin ay kailangan makuha ng user location, may alam po ba kayo kung paano makukuha ang accurate o nearly accurate na coordinates na kinatatayuan ng user?

Ito yung mga solusyon na mga naisip ko:

1. GetCurrentPosition - Dito nirereturn niya yung position ng isang user na nasa iisang lugar

function getData() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(providePosition,showError);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
PROBLEM: Paano kung lumipat yung user sa iba pang lubar (example: Nasa Point A (Makati) si user tapos sumakay siya ng Jeep papuntang Point B (Manila) yung problema dito, most likely i rereturn na value ay Point A at hindi Point B, yung ginawa kong solusyon ay nasa #2)

2. WatchPosition - Dito parang minomonitor niya yung bawat paggalaw ng isang user mula sa isang lugar papunta sa iba pang lugar

function getData() {
if (navigator.geolocation) {
navigator.geolocation.watchPosition(providePosition,showError);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
PROBLEM: Hindi gaano kaaccurate ang data at minsan nag rereturn ng mga coordinates na hindi mo pa nadadaanan.

May alam pa ba kayong paraan kung paano makakakuha ng isang accurate o near accurate na coordinate gamit ang Javascript, C# o iba pang langgwahe?
 
parang may kulang yung gamit mo sa watchPosition


JavaScript:
      geolocation.watchPosition(handleSuccess, errorCallback, {
        enableHighAccuracy: true,
        maximumAge: 5000 // 5 sec.
      });
 
Do you have permission to track your users? Is this tracking for the benefit of the user or for the benefit of whom?
Yeah there's a permission with regards to the user being tracked. It was defined on the project scope and user agreement together with a personal validation.
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 365
    Views
  • 4
    Participants
Last reply from:
1nn0c3ntv5

Online now

Members online
1,053
Guests online
710
Total visitors
1,763

Forum statistics

Threads
2,276,975
Posts
28,973,480
Members
1,229,674
Latest member
Mjivo
Back
Top