Pages

Feb 28, 2016

Get And Share Visitor's Location using Browser


Fetch your Sites Visitor's Location(Longitude & Lattitiude) using a simple javascript



if (navigator.geolocation) {
       
        navigator.geolocation.getCurrentPosition(function (position) {
          myLatLng = new google.maps.LatLng(position.coords.latitude,                  position.coords.longitude);
   alert(myLatLng )
        },
        function () {
                alert('fallback'); 
        });
     }

No comments: