Slow response and not accurate coordinate with locationsensor

Hi expert
i got a problem with locationsensor. its slow response and coordinate not accurate.
i create my app..viewing current location in leaflet js. i get latitude and longitude from loationsensor's latitude and longitude...but its slow response and not accurate lat and long.

any suggestion please


What are you expecting Yuda? How you coded the locationsensor to work (show an image of your Blocks please) and how frequently you tell the gps to try to provide a satellite fix might be the problem. How the LocationSensor works is described in Using the Location Sensor . There are two aia files you can load to test your GPS.

You said you 'create my app..viewing current location in leaflet js.; do you mean you use the MIT Map component or something else? The map tiles come from OpenStreetMap (OSM) . How rapidly they load on your device depend on their donated servers capabilities and your WIFI or network connections. Sometimes, the rendering is slow but usually quite fast.

You said 'not accurate lat and long'. Would you explain that please. The precision of the location provided by the GPS receiver depends on how many satellites is used in the satellite fix. The accuracy of the fix is influenced by many factors discussed in the above link. A modern cell phone GPS receiver can resolve a distance of 2 meters at best using the LocationSensor. It will provide about 10 meter or better resolution in most instances. Would you expain what is wrong with the latitude and longitude in your app? For reference, 0.00001 degrees of latitude represents about 1.11 meters at the equator

Have you discovered the LocationSensor and Map component documentation ( LocationSensor and Map components )?


this my block

i get current lat and long...than send them to leaftlet.js to draw it as a marker in a map.
sometimes i get the lat and long in a long time. when i was get lat and was draw a marker in a map..but the position of marker in a map exactly not the same where i am.

i also counting distance between my current position and another place i specified.

that all the block i create...i dont call the process in a timer.

Best Regard.

You use a javascript ( ) to create your map and display it in a WebView. You may be able to do that but you have issues. Evidently you are not getting the results you expect.

Thank you for your Block image; unfortunately the image is incomplete. Please show all your code if you want help and specific advice. No one can test your app with what you provided. You can use App Inventor's tools which provide a leaflet map using the Map component if you choose to instead.

Try the following: How to put my location on a map , The example provides a different mapping solution that works.

The Map component can be used with the LocationSensor to calculate distances between Markers and other features. The tools are described in my previous post.

I hope this information helps Yudha.

1 Like

2 posts were split to a new topic: Self-mobile attandance app

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.