| OLD | NEW |
| (Empty) | |
| 1 --- |
| 2 layout: default |
| 3 title: A Basic Geolocation Example |
| 4 live_example_url: example/index.html |
| 5 header: |
| 6 css: ["/samples/samples.css"] |
| 7 --- |
| 8 |
| 9 ## {{ page.title }} |
| 10 |
| 11 The Geolocation API lets you track a user's location. The API is |
| 12 device agnostic; the underlying mechanism might be via GPS, |
| 13 wifi, or simply asking the user to enter their location manually. Since |
| 14 these lookups can take some time, the API is asynchronous, and you |
| 15 pass it a callback method whenever you request a location. |
| 16 |
| 17 The Trip Meter example displays the user's initial location, and it |
| 18 tracks the distance the user has travelled since the page was loaded. |
| 19 |
| 20 You can open the example in Dart Editor and run it by clicking `index.html`. |
| 21 |
| 22 <iframe class="running-app-frame" |
| 23 style="height:300px;width:100%;" |
| 24 src="{{page.live_example_url}}"> |
| 25 </iframe> |
| 26 |
| 27 Read the |
| 28 [source](https://github.com/dart-lang/dart-samples/tree/master/web/html5/geoloca
tion/trip_meter). |
| 29 |
| 30 See all [samples](/samples/). |
| OLD | NEW |