title: Using Lat Long from model data in view to populate google map coordinates
body: <p>I have a small app that retrieves data from a database and displays information. It is all vehicle information and two of the fields are Latitude and Longitude.</p>
  
  <p>I am trying to get a map to show up when the user clicks "Details" but I cannot figure out how to get the model data into the function so that it shows.</p>
  
  <p>What I have tried.</p>
  
  <pre><code>//Setting a hidden input equal to the value
  &lt;input type='hidden' id='test-lat' value='@Html.Display(model =&gt; model.Lat)' /&gt;
  
  //Then starting the script
  &lt;script&gt;
         var a = $('#test-lat').val();
         var map;
         function initMap() {
             map = new google.maps.Map(document.getElementById('map'), {
                 center: {lat: a, lng: 41},
                 zoom: 8
             });
         }
  &lt;/script&gt;
  </code></pre>
  
  <p>This just gives me a gray box</p>