title: How to center my current position? (Google Maps)
body: <p>I'm trying to center my current location in Google Maps. This will center a location with a specific latitude- and longitude-variable.</p>
  
  <pre><code>var coords = new google.maps.LatLng(62.39081100, 17.30692700);
  </code></pre>
  
  <p>But I tried to grab the users location with this function:</p>
  
  <pre><code>function grabMyPosition() {
      if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(centerMe);
      } else {
          alert("You don't support this");
      }
  }
  function centerMe(center) {
      var me_location = {
          lat: position.coords.latitude,
          lon: position.coords.longitude
      };
  }
  </code></pre>
  
  <p>And then do this:</p>
  
  <pre><code>var coords = new google.maps.LatLng(me_location.lat, me_location.lon);
  </code></pre>
  
  <p>But then I get this:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'lat' of undefined 
  </code></pre>
  
  <p>That's because I'm storing and filling this "me_location" variable inside a function. How can I make it "global" so it could be used outside my function?</p>