var MapApiApplication = {
myCurrentPosition : "",
mapOptions : "",
marker : "",
initialize : function(){
MapApiApplication.myCurrentPosition = new google.maps.LatLng(10.112293000000000000, 76.352684500000010000);
MapApiApplication.mapOptions = {
zoom: 13,
center: MapApiApplication.myCurrentPosition,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
MapApiApplication.map = new google.maps.Map(document.getElementById('map-canvas'), MapApiApplication.mapOptions);
MapApiApplication.marker = new google.maps.Marker({
position: MapApiApplication.myCurrentPosition,
map: MapApiApplication.map,
title: 'Here You are'
});
},
};
I have the current position's latitude and longitude. How can i find nearby hospitals locations using only javascript and google maps api.
最佳答案
您需要使用 Places Library .在Place Search Requests您可以指定一个 type
- 它对您要搜索的地点的“类型”进行分类。根据Supported Place Types by Google Places API ,有 hospital
和 health
类型 - 这可能是您在搜索响应中找到医院的最佳选择。
关于javascript - 如何使用 google map api 和 javascript 查找附近的医院,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18722477/