0

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

duncan
  • 31,401
  • 13
  • 78
  • 99
Shellback
  • 33
  • 1
  • 5
  • https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation – duncan Mar 14 '16 at 16:26
  • http://www.w3schools.com/html/html5_geolocation.asp – ManoDestra Mar 14 '16 at 16:27
  • I tried that tutorail from w3school but it does not show me the nearby places : http://paste.ofcode.org/SqBNjxUaScLzacsRwtP89V – Shellback Mar 14 '16 at 16:35
  • possible Duplicate [SO ticket](http://stackoverflow.com/questions/8428209/show-current-location-and-nearby-places-and-route-between-two-places-using-googl) – KENdi Mar 15 '16 at 14:46

0 Answers0