How to pass an object to this js function?
<p>Code:</p>

<pre><code>function setMaps() {
    var geocoder = new google.maps.Geocoder();
    var result = "";

    $('.map_canvas').each(function(){

        geocoder.geocode( {
            'address': $(this).attr('address'), 
            'region': 'de'
        }, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                result += results[0].geometry.location.lng()+",";
                result += results[0].geometry.location.lat();
            } else {
                result = "Unable to find address: " + status;
            }
            $(this).gmap({ 'center': result });
        });
    });
}
</code></pre>

<p>This method should show multiple maps on one page.</p>

<p>HTML:</p>

<pre><code>&lt;div class="map_canvas" address="Berlin, Zoo"&gt;

&lt;/div&gt;
</code></pre>

<p>The problem is that <code>$(this).gmap({ 'center': result });</code> does not work:</p>

<pre><code>Uncaught TypeError: Cannot set property 'position' of undefined
</code></pre>

<p>Any idea how to pass the map_canvas object to the callback function?</p>
