title: how to center the map on current user location (geolocation
body: <p>I have this code that I want to center on user location because now it centers it it under the coordinates that I have (above Copenhagen, Denmark) and it's fixed. I need to make my code to center the map on the user location and to show the points around it</p>
  
  <pre><code>function initialize() {
  
  var locations = [
      ['kastelet', 55.6911, 12.5939],
      ['norebro', 55.6883, 12.5597],
      ['noreport', 55.6832, 12.5714],
      ['edisikvosi', 55.678272, 12.503643,],
      ['Sentosa', 55.713207, 12.526474,]
      ];
  
  var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 12,
      center: new google.maps.LatLng(55.6750, 12.5687),
      mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  
  var infowindow = new google.maps.InfoWindow();
  
  var marker, i;
  
  for (i = 0; i &lt; locations.length; i++) {
      marker = new google.maps.Marker({
          position: new google.maps.LatLng(locations[i][1], locations[i][2]),
          map: map
      });
  
      google.maps.event.addListener(marker, 'click', (function(marker, i) {
          return function() {
              infowindow.setContent(locations[i][0]);
              infowindow.open(map, marker);
          }
      })(marker, i));
  }
  
  // Check if user support geo-location
  if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
          var latitude = position.coords.latitude;
          var longitude = position.coords.longitude;
          var geolocpoint = new google.maps.LatLng(latitude, longitude);
  
          var mapOptions = {
              zoom: 8,
              center: geolocpoint,
              mapTypeId: google.maps.MapTypeId.HYBRID
          }
          // Place a marker
          var geolocation = new google.maps.Marker({
              position: geolocpoint,
              map: map,
              title: 'Your geolocation',
              icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png'
          });
      });
  }
  }
  google.maps.event.addDomListener(window, 'load', initialize);​
  </code></pre>