title: Geolocation with Google Maps not working using PhoneGap
body: <p>I am using Phonegap (cordova-2.0.0) and I have put cordova-2.0.0.js in the assets/www directory with my other files, I have put cordova-2.0.0.jar in the referenced libraries. I have added the required code in the Android manifest and config.xml. And I have made an html file called 'storelocation.html', I want this file to get the user's current coordinates and pass those into Google maps which will make those coordinates at the centre of the maps. I am not sure what is wrong with the code in this file, could somebody please check to see if I am just being stupid? </p>
  
  <pre><code>&lt;!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
  
  &lt;title&gt;Device Properties Example&lt;/title&gt;
  
  &lt;script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"&gt;&lt;/script&gt;
  &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=AIzaSyBlNOgoh-8Xg9_OYqUUxReMJZk4syLFayM&amp;sensor=true"type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  // Wait for Cordova to load
  
  document.addEventListener("deviceready", onDeviceReady, false);
  
  // Cordova is ready
  //
  function onDeviceReady() {
  navigator.geolocation.getCurrentPosition(onSuccess, onError,         {enableHighAccuracy:true });
  }
  
  // onSuccess Geolocation
  //
  /* function onSuccess(position) {
      var element = document.getElementById('geolocation');
      element.innerHTML = 'Latitude: '           + position.coords.latitude              +   '&lt;br /&gt;' +
                          'Longitude: '          + position.coords.longitude             + '&lt;br /&gt;' +
                          'Altitude: '           + position.coords.altitude              + '&lt;br /&gt;' +
                          'Accuracy: '           + position.coords.accuracy              + '&lt;br /&gt;' +
                          'Altitude Accuracy: '  + position.coords.altitudeAccuracy      + '&lt;br /&gt;' +
                          'Heading: '            + position.coords.heading               + '&lt;br /&gt;' +
                          'Speed: '              + position.coords.speed                 + '&lt;br /&gt;' +
                          'Timestamp: '          +                                   position.timestamp          + '&lt;br /&gt;';
  } 
  
  // onError Callback receives a PositionError object
  //
  function onError(error) {
      alert('code: '    + error.code    + '\n' +
            'message: ' + error.message + '\n');
  } */
              var element = document.getElementById('geolocation');
  
  
  function initialize() {
  if (GBrowserIsCompatible()) {
  var map = new GMap2(document.getElementById("map_canvas"));
  map.setCenter(new GLatLng(position.coords.latitude, position.coords.longitude), 13);
  map.setUIToDefault();
  
  }
  }
  
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="initialize()" onunload="GUnload()"&gt;
  &lt;div id="map_canvas" style="width: 500px; height: 300px"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Many thanks in advance, I really do appreciate it if one of you geniuses could help me out, I have been trying to see what's wrong for like 2 days now. Btw, the user's coordinates could not be found and the only way to find them (that I found) is to use geo fix using telnet but I want the phone to find the coordinates and not me. </p>