When I search for any sizeable location in Google, the results page includes a sidebar with information about that city, and often includes a list of Points of Interest:
If I click the 'View 15+ More' link, I get a scrollable view with lots more:
Is there any way to get these places (or similar) via the Places API? You can do nearby, text and radar searches based on a location, and you have to specify a single type (from this list), or you can use a types
array for several at once, but it is deprecated.
My main problem is that the Places API gives you a pretty mixed bag of results, often not particularly relevant or noteworthy. And how do you select just the right types, and get the best attractions? Whereas Google's own results pages have a very good selection of the top attractions.
For instance doing a nearby search, if I omit the type
parameter, I mostly just get a list of hotels for central London:
function initialize() {
var centre = new google.maps.LatLng(51.506974, -0.127488);
var map = new google.maps.Map(document.getElementById("map"), {
zoom: 15,
center: centre,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: centre,
radius: 1000
}, function (results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
console.log(results[i].name);
}
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);
html, body, #map { width: 100%; height: 100% }
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places"></script>
<div id="map"></div>
This returns:
- London
- The Trafalgar Hotel
- Citadines Trafalgar Square London
- Corinthia Hotel London
- Amba Hotel Charing Cross
- Haymarket Hotel
- The Royal Horseguards
- Sofitel London St James
- Radisson Blu Edwardian, Hampshire
- every hotel Piccadilly
- Premier Inn London Leicester Square
- W London Leicester Square
- The Savoy
- Strand Palace Hotel
- Le Méridien Piccadilly
- Piccadilly Guest House
- The Cavendish London
- The Z Hotel Soho
- The Grand At Trafalgar Square
- Soho
If I add type: ['museum']
to the request, I get this fairly random list instead. The first 5 or so aren't bad, then it goes a bit awry:
- Churchill War Rooms
- The National Gallery
- National Portrait Gallery
- London Transport Museum
- The Courtauld Gallery
- London Film Museum
- Jewel Tower
- 19 Greek Street
- Spencer House Ltd
- The Household Cavalry Museum
- Whitfield Fine Art (art dealer)
- ICA Bar & Cafe
- Anatomy Museum
- Max Rutherston Ltd (art dealer)
- Hazzlitt Holland-hibbert (art dealer)
- Fossils London (shop)
- London Original Print Fair (name of a temporary exhibition)
- Diana's Dresses (name of a temporary exhibition)
- English Heritage
- الطرف الاغر (translated: "Trafalgar")
Alternatively any 3rd party API which might have similar (but better) results could be useful.