title: Show markers on map from code behind
body: <p>I am trying to implement google maps Jquery version i.e. <a href="http://gmap3.net/" rel="nofollow noreferrer">GMAP3</a></p>
  <p>I am calling the script from the following c# code</p>
  <p><strong>EDIT:</strong></p>
  <pre><code>void drawMap(List&lt;beatWithCurrentStatus&gt; mapList, bool IsMap)
  {       
      ScriptManager.RegisterStartupScript(this, this.GetType(), &quot;functiona&quot;, &quot;designMap(&quot; + ConvertToJSON(mapList) + &quot;);&quot;, true);
  }
  </code></pre>
  <p>and the following is my script</p>
  <pre><code>function designMap(JSONData) {
  var ll = [];
  var address = [];
  
  for (var i = 0; i &lt; JSONData.length; i++) {
      //        ll[i] = '{latLng:\'[' + data[i].lastlatitude + ',' + data[i].lastlongitude + ']\',data:\'' + data[i].lastaddress + '\'}';
      ll[i] = { latLng: [JSONData[i].lastlatitude, JSONData[i].lastlongitude], data: JSONData[i].lastaddress };
  }
  alert(ll);
  $('#mapDiv').gmap3({
      map:
  {
      options: {
          center: [JSONData[5].latitude, JSONData[5].longitude],
          zoom: 7,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          mapTypeControl: true,
          mapTypeControlOptions: {
              style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
          },
          navigationControl: true,
          scrollwheel: true,
          streetViewControl: true
      }
  
  },
      marker: {
          values: ll,
          options: {
              draggable: false
          }
      }
  
  });
  }
  </code></pre>
  <p>Edit:
  This is the JSON I am getting from ConvertToJSON(mapList) function</p>
  <pre><code>[{&quot;number&quot;:1,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400024706&quot;,&quot;place&quot;:&quot;Noida Region&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1346265000000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:28.535516,&quot;longitude&quot;:77.391026,&quot;distance&quot;:13.64,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(1360653137000)\/&quot;,&quot;laststatusCode&quot;:61715,&quot;lastlatitude&quot;:47.787773,&quot;lastlongitude&quot;:-2.449187,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:&quot;D151,56140 Bohal,,France&quot;,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:&quot;1&quot;,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:2,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400024706&quot;,&quot;place&quot;:&quot;Delhi Region&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1346265000000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:28.635308,&quot;longitude&quot;:77.22496,&quot;distance&quot;:13.64,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(-62135596800000)\/&quot;,&quot;laststatusCode&quot;:0,&quot;lastlatitude&quot;:0,&quot;lastlongitude&quot;:0,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:null,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:null,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:3,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400024706&quot;,&quot;place&quot;:&quot;Noida&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1347474600000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:28.535516,&quot;longitude&quot;:77.391026,&quot;distance&quot;:13.64,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(-62135596800000)\/&quot;,&quot;laststatusCode&quot;:0,&quot;lastlatitude&quot;:0,&quot;lastlongitude&quot;:0,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:null,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:null,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:4,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400023872&quot;,&quot;place&quot;:&quot;State Highway 264, Maharashtra, India&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1347906600000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:20.593684,&quot;longitude&quot;:78.96288,&quot;distance&quot;:1,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(1349955039000)\/&quot;,&quot;laststatusCode&quot;:61715,&quot;lastlatitude&quot;:27.22787287,&quot;lastlongitude&quot;:77.99955692,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:&quot;Agra, Uttar Pradesh,India&quot;,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:&quot;21&quot;,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:5,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400023872&quot;,&quot;place&quot;:&quot;State Highway 264, Maharashtra, India&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1347993000000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:20.593685,&quot;longitude&quot;:78.96288,&quot;distance&quot;:1,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(-62135596800000)\/&quot;,&quot;laststatusCode&quot;:0,&quot;lastlatitude&quot;:0,&quot;lastlongitude&quot;:0,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:null,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:null,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:6,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400023872&quot;,&quot;place&quot;:&quot;233-277324079&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1348425000000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:20.593684,&quot;longitude&quot;:78.96288,&quot;distance&quot;:1,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(-62135596800000)\/&quot;,&quot;laststatusCode&quot;:0,&quot;lastlatitude&quot;:0,&quot;lastlongitude&quot;:0,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:0,&quot;lastaddress&quot;:null,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:null,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null},{&quot;number&quot;:7,&quot;accountID&quot;:&quot;primecomforts&quot;,&quot;deviceID&quot;:&quot;911227400077050&quot;,&quot;place&quot;:&quot;B-89,TEACHERS COLONY ,SAMAYPUR BADLI,DELHI&quot;,&quot;status&quot;:1,&quot;statusString&quot;:null,&quot;requestTimestamp&quot;:&quot;\/Date(1348597800000)\/&quot;,&quot;mobileNumber&quot;:null,&quot;latitude&quot;:20.593684,&quot;longitude&quot;:78.96288,&quot;distance&quot;:1,&quot;summary&quot;:null,&quot;url&quot;:&quot;Image/default-location-image.png&quot;,&quot;charrgingStatus&quot;:0,&quot;lasttimestamp&quot;:&quot;\/Date(1360642473000)\/&quot;,&quot;laststatusCode&quot;:61715,&quot;lastlatitude&quot;:28.63164532,&quot;lastlongitude&quot;:77.34991008,&quot;lastspeedKPH&quot;:0,&quot;lastheading&quot;:-42.464634,&quot;lastaddress&quot;:&quot;National Highway 24 Bypass, Vaishali, Ghaziabad, Ghaziabad, Ghaziabad, Uttar Pradesh, 201010, India&quot;,&quot;lastodometerKM&quot;:null,&quot;stringDateTime&quot;:null,&quot;lastVDOP&quot;:&quot;62&quot;,&quot;lastCharrgingStatus&quot;:0,&quot;smsType&quot;:null,&quot;pointsource&quot;:0,&quot;sno&quot;:null,&quot;cellTowerId&quot;:null,&quot;data&quot;:null,&quot;latLng&quot;:null}]
  </code></pre>
  <p><strong>Edit2:</strong></p>
  <pre><code>string ConvertToJSON(List&lt;beatWithCurrentStatus&gt; receivePoints)
  {
      JavaScriptSerializer jss1 = new JavaScriptSerializer();
      return jss1.Serialize(receivePoints);
  }
  </code></pre>
  <p>How should I pass the markers in the map??? Please help..! I've tried all methods but none is working. However if I hard code the values, It shows up on the map.</p>
  <p>Please help.. :(</p>