Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<script>
$(document).ready(function () {
$.get("http://ipinfo.io", function (response) {
var a = "http://ipinfo.io/" + response.ip + "";
$.get(a, function (response) {
var lats = response.loc.split(',')[0];
var lngs = response.loc.split(',')[1];
var a = lats;
var b = lngs;
var mapOptions = {
center: new google.maps.LatLng(a, b),
zoom: 10,
mapTypeId: google.maps.MapTypeId.HYBRID
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
}, "jsonp");
}, "jsonp");
}); 
 
</script>
<div id="map" style="width:300px;height:300px;background:orange"></div>
// YOUR API KEY get from Google API Console.
<script src="https://maps.googleapis.com/maps/api/js?key=Your Api Key "></script>
</body>
</html> 
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY Click to see more ... 10.5K 1.8K