Google Maps API, How to Get Services (text Search) in Whole City or the whole portion of map that is in view

女生的网名这么多〃 提交于 2019-12-24 14:53:54

问题


When I did a Text Search with

var request = {
    location: placeobject,
    radius: 50000,
    query: placetypes
//  types: placetypes
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);

But All I Get is the chunk of services clogged near the location i send, but how to specify text search to mark all such services in the whole city or a wider region to be searched.

Screenshot of what i get is


回答1:


You can't get "the whole city".

textSearch and nearBySearch are limiited to 60 results total, in groups of 20.

By default, each Place search returns up to 20 establishment results per query; however, each search can return as many as 60 results, split across three pages.

radarSearch will return up to 200 results, but with less detail.

A Places Radar Search is initiated with a call to the PlacesService's radarSearch() method, which will return an array of up to 200 PlaceResult objects. PlaceResult objects returned by radarSearch() will only include the geometry.location and reference properties.



来源:https://stackoverflow.com/questions/20683098/google-maps-api-how-to-get-services-text-search-in-whole-city-or-the-whole-po

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!