Skip to content Skip to sidebar Skip to footer

Google Maps Api V3 Places Search - Pass In Another Parameter To Callback Function

I am using the Google Maps places API v3 to return a number of 'types' of places, each represented by a different marker on the map. I create a google.maps.places.PlacesService obj

Solution 1:

How about the following:

service.search(req_bank, function (results, status) {
  locations(results, status, "bank");
});

function locations(results, status, type) {
  if (status == google.maps.places.PlacesServiceStatus.OK) {
    // check the type to determine the marker, or pass a url to the marker icon
  }
}

Post a Comment for "Google Maps Api V3 Places Search - Pass In Another Parameter To Callback Function"