title: Current location is not being found - Google Maps API
body: <p>I am learning google maps API and am trying to find the current location along with the marker on the map. Marker is working perfectly but current location part is not working. My code is attached below.Please tell me where i am wrong.</p>
  
  <pre><code>&lt;script&gt;
  var map;
  var myCenter = new google.maps.LatLng(13.0827, 80.2707)
  
  
  var map;
  function initialize() {
    var myLatlng = myCenter;
    var mapOptions = {
      zoom: 4,
      center: myLatlng
    }
    var map = new google.maps.Map(document.getElementById('map'), mapOptions);
  
    var marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        draggable: true
        });
        // To add the marker to the map, call setMap();
        marker.setMap(map);
  
    if(navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        var pos = new google.maps.LatLng(position.coords.latitude,
                                         position.coords.longitude);
  
        var infowindow = new google.maps.InfoWindow({
          map: map,
          position: pos,
          content: 'Great! your location is found.'
        });
  
        map.setCenter(pos);
      }, function() {
        handleNoGeolocation(true);
      });
    } else {
      // Browser doesn't support Geolocation
      handleNoGeolocation(false);
    }
  }
  
  
  function handleNoGeolocation(errorFlag) {
    if (errorFlag) {
      var content = 'Error: The Geolocation service failed.';
    } else {
      var content = 'Error: Your browser doesn\'t support geolocation.';
    }
  
    var options = {
      map: map,
      position: new google.maps.LatLng(60, 105),
      content: content
    };
  
    var infowindow = new google.maps.InfoWindow(options);
    map.setCenter(options.position);
  }
  google.maps.event.addDomListener(window, 'load', initialize);
  &lt;/script&gt;
  </code></pre>