I am working with thr API Google Maps .I put specific coord .THis is the code:
$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);
}
}
Also I searchy for neaby places wich is works now .($scope.choice is updating automatically when user select an item) How can I detect the current location of user and have also that part with place nearby?
Thank you