summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-05-25 02:09:54 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-05-25 02:09:54 (GMT)
commit7a405bb1b318d69d70e3fe61b0e26714ad4748e2 (patch)
treed951669897574f5bcf8713974ff550dd07c455d8 /examples
parent38b329ae7dd7471b08e75b2f0f4615c4b787ece4 (diff)
downloadQt-7a405bb1b318d69d70e3fe61b0e26714ad4748e2.zip
Qt-7a405bb1b318d69d70e3fe61b0e26714ad4748e2.tar.gz
Qt-7a405bb1b318d69d70e3fe61b0e26714ad4748e2.tar.bz2
geolocation (untested)
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/declarative/modelviews/webview/content/Mapping/map.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/declarative/modelviews/webview/content/Mapping/map.html b/examples/declarative/modelviews/webview/content/Mapping/map.html
index a8726fd..a98da54 100755
--- a/examples/declarative/modelviews/webview/content/Mapping/map.html
+++ b/examples/declarative/modelviews/webview/content/Mapping/map.html
@@ -25,6 +25,14 @@
} else {
goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
}
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
}
function goToAddress() {
if (geocoder) {