title: Google Maps API: Detecting location and dropping a marker
body: <p>Using Google's example code for detecting a user's location, I setup a basic page that detects a user's location on a map. I also setup a separate page that drops a marker on a map at a specific coordinate. I want to combine these functions into one script. That is, I want to drop a marker on the map at the location detected, but I can't seem to get it to work. My code detects the user's location, but doesn't drop a marker. I'm sure it's something simple, but I'm not familiar with Javascript, so I'm having trouble resolving the problem. </p>
  
  <p>Below is Google's example code. What would I need to add to display the marker at initialLocation? I tried adding the following code:</p>
  
  <pre><code>    var marker = new google.maps.Marker({
          position: initialLocation,
          map: map,
          title: "You are here"
  });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/11pAw.jpg" alt="Google&#39;s example code"></p>