Reputation: 7745
i'm programmaticaly trying to set dynamicaly the types of the places i want to search , i have an array selectedPlaceTypes filled as follows : ["aquarium", " art_gallery", " bar"] . only one type in the array is taken into account .
var request = {
location: pos,
radius: 5000,
types: selectedPlaceTypes
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
Upvotes: 0
Views: 1003
Reputation: 16068
In documentation, it says: types — Restricts the results to Places matching at least one of the specified types. Types should be separated with a pipe symbol (type1|type2|etc).
So use var types="aquarium|art_gallery|bar"
.
Or maybe the problem is just the spaces you have in art_gallery
and bar
Upvotes: 1