title: Good way to load multiple lat/long points from a database into google map markers?
body: <p>I have a table containing multiple addresses, including their Lat/Long coordinates, and I want to place many of these markers onto a google map at once, using asp.net webforms and Google Maps Javascript API V3.</p>
  
  <p>The tutorials show how to add one marker:<br>
  <a href="http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers" rel="noreferrer">http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers</a></p>
  
  <pre><code> var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
    var myOptions = {
      zoom: 4,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map, 
        title:"Hello World!"
    });
  </code></pre>
  
  <p>My question is, after I've loaded the set of multiple addresses server side (codebehind), what is a <strong>good</strong> way to output this set into the html such that client side javascript can iterate the collection and place markers onto the map.</p>
  
  <h2>Update</h2>
  
  <p>If I <em>already</em> had created my set, what would be a decent way of pushing that out into the page's html at render time, without calling an external script? (Passing the complex filter parameters to the script would be complicated so I'd rather avoid this.)  Should I literally just use a stringbuilder to construct a javascript function containing the proper json array and then append that function to the page? That would work, but it doesn't seem quite proper.</p>