title: How can we create a data array for google map markers using data from asp.net mvc model?
body: <p>I want to create a data array in JavaScript for google map markers using data from asp.net mvc model and wrote this snippet</p>
  <pre><code> var locations = [];
  @foreach (var d in Model.Properties.Where(p=&gt;p.Longitude!=null))
  {
  @:locations.push(&quot;@d.Description&quot;, &quot;@d.Latitude&quot;, &quot;@d.Longitude&quot;,@d.Id);
  }
  
  </code></pre>
  <p>But I am not getting the expected results, as there is a problem with the data array which I want to be like this one bellow</p>
  <pre><code>var locations = [
    ['Bondi Beach', -33.890542, 151.274856, 4],
    ['Coogee Beach', -33.923036, 151.259052, 5],
    ['Cronulla Beach', -34.028249, 151.157507, 3],
    ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
    ['Maroubra Beach', -33.950198, 151.259302, 1]
  ];
  </code></pre>