How to use Google map.data.loadGeoJson with a JSON string?
<p>I need to load multiple sequential data layers on my Google map.
I use a servlet to generate the <code>GeoJSON</code> string, which is retrieved by a <code>XMLHttpRequest</code>. Then I want to load it using <code>map.data.loadGeoJson</code>, but it expects a file as a parameter.
I feel that writing the <code>GeoJSON</code> file on the server and then giving the URL as parameter is not efficient.</p>

<p>Is there a way to trick <code>loadGeoJson</code> so it accepts the <code>JSON</code> string from the servlet ? For example, something like : </p>

<pre><code>    xhr = new XMLHttpRequest();
    xhr.open("GET","/hello/MyHello?date="+ d.toISOString(),true);
    xhr.onreadystatechange = function() {
        if (this.readyState == 4 &amp;&amp; this.status == 200) 
        {
            var geoJSON = JSON.parse(this.responseText);
            map.data.loadGeoJson(geoJSON );
        }
    };
</code></pre>