From 7a405bb1b318d69d70e3fe61b0e26714ad4748e2 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 25 May 2010 12:09:54 +1000 Subject: geolocation (untested) --- examples/declarative/modelviews/webview/content/Mapping/map.html | 8 ++++++++ 1 file changed, 8 insertions(+) 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) { -- cgit v0.12