Get coordinates for any Location on Google Maps back to App Inventor
Everything you want to know about Google Maps (well almost) is probably here: https://developers.google. com/maps/
Is it possible to get a location fix using Google Maps? Yes. Type 4000 Pennsylvania Ave Washington, D.C. into your browser search and you can get: https://www.google.com/maps/ place/4000+Pennsylvania+Ave+ SE,+Washington,+DC+20020/@38. 864287,-76.94721,17z/data=! 3m1!4b1!4m2!3m1! 1s0x89b7b910b5aa3a25: 0xb3360cbac3bc6d8e This is the latitude and longitude of that address: 38.864287,-76.94721
The second part might be more difficult. You should be able to capture that location data using the Web component; parse the url and you have the coordinates.
..."without having to ever enter anything manually? well, perhaps. Once you have the coordinates in your app, you can do anything you want to do with them, you can post them on a Google Static Map, you can post them on your own flat map, you can calculate the distance from the captured location to another location etc.
Or maybe you want to do something a little differently? Then you need to be more explicit about what you want to do Branden.
Try some things.
Guess i dont need to use it....but i do need to be able to use all available providers to get a hood location fix quickly, say withing about 10 seconds or so. My app currently doesnt get the fix quick at all. How can i use all available providers?
There are several MIT tutorials that touch on the subject of mapping using Google and using the LocationSensor... have you done the tutorials? They are here: http://appinventor.mit.edu/ explore/ai2/tutorials3818. html?&page=2
The LocationSensor tutorial explains how to use all providers. Be aware, the gps is the most accurate, the other options are less accurate. The gps may take 2 to 20 seconds or more to get a satellite fix. It takes longer to get a fix under cover (in a building, under trees, driving through a skyscraper canyon). How long it takes to get a fix is influenced by many factors w.r.t. gps, the quality of the GPS receiver is one issue.
Be aware, to use the other settings other than gps, you must allow Google to find your location (you either deny them or accept them using the Android Settings in the device under Location. depending on the Android version, there are several options).
I have done the tutorials. Also, found somewhere at one point in time a timer for waiting for the location to get a fix, can you point me in the direction of one?
The 'timers' all have values in milliseconds (ms). 1000 ms = 1 second. One should never ask the gps to get a fix more frequently than about five ms ..about the speed most phones will take to get a fix under 'average conditions'. Also, under less than ideal conditions the gps will either to fail to get a fix or take about 20 seconds or more. I am not sure if there is a default time when the gps decides that a satellite fix failed or not. I would never sample once more than every 10 seconds and believe once a minute is probably adequate for most apps. If you call the gps to resample and it has not yet obtained a fix, it could go into a loop such that the sensor will never update a fix.
Not sure what you are asking about here: "a timer for waiting for the location to get a fix," ... could you clarify?
댓글 없음:
댓글 쓰기