Yang mungkin sedang merencanakan aplikasi yang mempunyai fasilitas tracking. Berikut ini adalah contoh html untuk mendapatkan posisi GPS. Aplikasi ini menggunakan javascript. Coding utamanya adalah seperti berikut ini: Jika menggunakan Android pastikan aktif setting untuk Location Acess yang meliputi: Javascriptnya dapat didownload di https://code.google.com/p/geo-location-javascript/downloads/list . Coding lengkapnya adalah: Posisi GPS Informasi lebih lengkap silahkan mengunjungi: 1. https://code.google.com/p/geo-location-javascript/ Di tulis oleh: admin Note: As of Chrome 50, the Geolocation API will only work on secure contexts such as HTTPS. If your site is hosted on an non-secure origin (such as HTTP) the requests to get the users location will no longer function. Using HTML GeolocationThe The example below returns the latitude and longitude of the user's position: ExampleExample explained:
The example above is a very basic Geolocation script, with no error handling. Handling Errors and RejectionsThe second parameter of the Examplefunction showError(error) { Location-specific InformationThis page has demonstrated how to show a user's position on a map. Geolocation is also very useful for location-specific information, like:
The getCurrentPosition() Method - Return DataThe Geolocation Object - Other interesting MethodsThe Geolocation object also has other interesting methods:
The example below shows the |