title: Showing a Google map with a button click
body: <p>I've tried to put together a single script which shows a google map when the button click and then reads the coordinates from two input fields.</p>
  
  <p>This is the code I have written: <a href="http://jsfiddle.net/spadez/2r9tC/3/" rel="nofollow">http://jsfiddle.net/spadez/2r9tC/3/</a></p>
  
  <pre><code>// MAP DISPLAY CODE
  function mapDisplay() {
  
  var latval = $('input[id=lat]').val();
  var lngval = $('input[id=lng]').val();    
  
      var mapOptions = {
          zoom: 8,
          center: new google.maps.LatLng(latval, lngval),
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions)
  });
  
  // 
  $(function() {
      $('#action').click(mapDisplay);
  });
  </code></pre>
  
  <p>I'm really not having any luck so I was wondering if someone could tell me where I have gone wrong. </p>
  
  <p>Thank you.</p>