我正在使用thr API Google Maps。我提出了特定的coord。我是代码:
$scope.init = function() {
var latlon = new google.maps.LatLng(47.1312627, 27.5643737);
mapCanvas = document.getElementById('mapholder');
mapCanvas.style.height = '860px';
map = new google.maps.Map(document.getElementById('mapholder'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: latlon,
zoom: 15
});
var currentMarker = new google.maps.Marker({
map: map,
position: latlon,
icon: 'img/Standing Man-48.png',
title: 'Current Location'
});
var myinfowindow = new google.maps.InfoWindow({
content: 'You are here'
});
myinfowindow.open(map, currentMarker);
if ($scope.choice != '') {
var request = {
location: latlon,
radius: 7000,
// query: 'atm'
types: [$scope.choice]
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
}
}
我也在搜索现在可以使用的neaby地方。($ scope.choice在用户选择项目时自动更新) 如何检测用户的当前位置并将该部分放在附近?
谢谢