diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/declarative/modelviews/webview/content/Mapping/map.html | 8 |
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) { |