title: Multiple markers on Googe Map Api in MVC asp.net
body: <p>I'm working about a web application in Asp.net MVC and i need to add multiple markers on Google Maps Api JavaScript.</p>
  
  <p>In the View, I call a model which is a list of Vehicles Object.</p>
  
  <pre><code>&lt;script&gt;
  
  
  
  function initMap() {
  
      var myLatLng = { lat: 48.584715, lng: 7.748556 };
  
      // Create a map object and specify the DOM element
      // for display.
      var map = new google.maps.Map(document.getElementById('carte'), {
          center: myLatLng,
          zoom: 14
      });
  
      // Create a marker and set its position.
  
      @foreach(var item in Model){
           &lt;text&gt;
                var marker = new google.maps.Marker({
                map: map,
                position: { lat: @item.VehicleLocation.Latitude, lng: @item.VehicleLocation.Longitude },
                title: 'Hello World!'
          &lt;/text&gt;
          }
  
  }&lt;/script&gt;
  </code></pre>
  
  <p>I use the <code>@foreach</code> block to place a marker for each objet of the list.</p>
  
  <p>Without this @foreach part, we can see the map.
  But when I put the @foreach, the map is not displayed.</p>
  
  <p>I don't understand the problem</p>
  
  <p>How can I solve it ?</p>