Hello,

I'm looking for a solution using Geocoding.
I work on an asynchronous maps API (JS V3).

The first geocoder is used to center the map on a region selected by
the user (via multiple dropdown).
Here no problem it's running.
The second geocoding function I wanted to push have to push the
markers via a string request (brand stores here)
But it's not running well.. May have I made a mistake here.

Can you help me ? :)

    geocoder = new google.maps.Geocoder();
    geocoder.geocode( { 'address': masterSelection },
function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                map.setCenter(results[0].geometry.location);
                } else {
                  alert("Geocode was not successful for the following reason: " 
+
status);
                }
    });

        geocoder2 = new google.maps.Geocoder();
        var brandName = "Brand Name";
        geocoder2.geocode( { 'address': brandName }, function(resultat, etat)
{
                if (etat == google.maps.GeocoderStatus.OK) {
                        var marker = new google.maps.Marker({
                        map: map,
                        position: resultat[0].geometry.location
                        });
                } else {
                  alert("MARKER PROBLEM: " + etat);
                }
    });


Thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to