我想获取特定类型的附近位置,但谷歌地图上不存在该类型。我想添加该类型。我们是否可以在谷歌地图上添加类型。
谷歌地图上不存在类型。
您可以添加此代码:
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: theLocation.value,
radius: radius,
type: ['restaurant'],
openNow: true,
minPriceLevel: minprice
}, yourCallback);
并使用
type
参数指定您要查找的位置类型(这里我们找到一些餐馆)。
您可以查阅文档类型参数在附近搜索的描述中指定。
如果您有任何疑问请告诉我。
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: theLocation.value,
radius: radius,
type: ['restaurant'],
openNow: true,
minPriceLevel: minprice
}, yourCallback);