问题
My site shows Gmap with few places categories (cafe, pharmacy. bank, etc...) Some categories ALWAYS returns 'ZERO_RESULTS' while Only two returns results.
Here is an example for a good request-
https://maps.googleapis.com/maps/api/js/PlaceService.FindPlaces?1m6&1m2&1d32.0644854235794&2d34.78186263896919&2m2&1d32.073468576420595&2d34.79246336103074&2siw&6sparking&callback=_xdc_._pocujy&token=76152
Here is an example for a bad request-
https://maps.googleapis.com/maps/api/js/PlaceService.FindPlaces?1m6&1m2&1d32.0644854235794&2d34.78186263896919&2m2&1d32.073468576420595&2d34.79246336103074&2siw&6sbank&callback=_xdc_._g07omw&token=49745
As you can see the 'bad' request returns this-
_xdc_._g07omw && _xdc_._g07omw( {
"html_attributions" : [],
"results" : [],
"status" : "ZERO_RESULTS"
}
)
- The answer is ZERO for any location on my map (Israel Map)
- The Places do exist and should appear (like in maps.google.co.il)
Do you have an idea what's wrong here?
回答1:
The reason for this behavior is most likely the fact that Google hasn't yet added the actual categories (types
) to all the places in its database. So, for example, a place which you actually know that it should return with "types" : [ "cafe", "restaurant", "establishment" ]
, it will return instead with only "types" : [ "establishment" ]
.
So, until the missing types
are included, a less-precise workaround might be filtering those categories by name
or keyword
parameter, which might increase the chances of returning (at least some) relevant results.
来源:https://stackoverflow.com/questions/16123878/my-places-api-returns-zero-results