[Google Maps Api] 現在地を表示する

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 100% }
</style>
<script type="text/javascript"
    src="http://maps.google.com/maps/api/js?sensor=true">
</script>
<script type="text/javascript">
 var initialLocation = new google.maps.LatLng(35.65861, 139.745447);
 var browserSupportFlag =  new Boolean();

 function initialize() {
  var myOptions = {
    zoom: 16,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
  // Try W3C Geolocation (Preferred)
  if(navigator.geolocation) {
    browserSupportFlag = true;
    navigator.geolocation.getCurrentPosition(function(position) {
      initialLocation = new  google.maps.LatLng(position.coords.latitude,position.coords.longitude);
      map.setCenter(initialLocation);
  var beachMarker = new google.maps.Marker({
      position: initialLocation,
      map: map,
  });
 
 
    }, function() {
      handleNoGeolocation(browserSupportFlag);
    });
  // Browser doesn't support Geolocation
  } else {
    browserSupportFlag = false;
    handleNoGeolocation(browserSupportFlag);
  }
  
  function handleNoGeolocation(errorFlag) {
    if (errorFlag == true) {
      alert("GPS信号を受信しませんでした.");
    } else {
      alert("このブラウザは現在地表示に対応していません。");
    }
    map.setCenter(initialLocation);
  }

  var beachMarker = new google.maps.Marker({
      position: initialLocation,
      map: map,
  });
  
 }
  
 </script>
 </head>
 <body onload="initialize()">
   <div id="map_canvas" style="width:100%; height:100%"></div>
 </body>
</html>