 <p>The reason is that your <em>PageMethods.GetMarkers</em> is asynchronous, so the data hasn't loaded when you invoke <em>DrawMap</em>. I guess when you use the alert, it pauses execution long enough for the data to load. Put the <em>DrawMap</em> method inside the <em>OnSuccess</em> of the page method, and that should solve the problem.</p>