Skip to main content
1 answer
  1. Sep 13, 2017, 6:21 AM
    Hi Uttam,

     

    Its just a thought. There are many services (like http://ip-api.com) available from where you can get the geolocation by calling there APIs.

     

    You can try to call this api via javascript at front end and pass the geolocation to controller. The javascript is as below. Hope this helps.

     

    function myGeoLocation() {

    if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest();

     

    else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

     

    xmlhttp.open("GET","http://ip-api.com/json",false);

     

    xmlhttp.send();

     

    var obj = JSON.parse(xmlhttp.responseText);

     

    return obj;

    }

     

    Thanks

     

    David Hales

     

    1071
0/9000