Anil Labs

Tuesday, November 24, 2009

We get the address by latitude and longitude -using php code

19 comments:

  1. Hi this code is not work

    Warning: Wrong parameter count for mb_detect_encoding() in /opt/lampp/htdocs/map/map3.php on line 22

    Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unknown encoding "-8" in /opt/lampp/htdocs/map/map3.php on line 22

    Warning: Wrong parameter count for mb_detect_encoding() in /opt/lampp/htdocs/map/map3.php on line 23

    Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unknown encoding "-8" in /opt/lampp/htdocs/map/map3.php on line 23

    bool(false)

    ReplyDelete
  2. Useful but please write a post How to detect user's country?
    Thanx for your help anil.

    ReplyDelete
  3. The code was really helpful and easy to understand. Thanks Anil

    Hi Dharmveer,

    You can get the code for "How to detect user's country" from:

    http://www.phpclasses.org/browse/package/2363.html

    ReplyDelete
  4. Thanks... Its really working..

    ReplyDelete
  5. Its really very usefull ....
    thanks .

    ReplyDelete
  6. [...] 5)We get the address by latitude and longitude -using php code [...]

    ReplyDelete
  7. What does this do please
    $url="http://maps.google.com/maps/geo?q=$lat,$long&output=csv&sensor=false&key=".$key;

    ReplyDelete
  8. Hi I am using the code but it is giving me bool(false) where i am using

    echo "";
    var_dump($data);
    echo "";

    Please tell me what to do... whats wrong in my code

    ReplyDelete
  9. @Mayank , This code using older version of google map api. It will be working for v2. I will update the post using v3 API.

    ReplyDelete
  10. Hi Anil,

    is there any Java corresponding code please?

    ReplyDelete
  11. No. I don't have java related stuff in this blog.

    ReplyDelete
  12. It is really good..
    Thanks

    ReplyDelete
  13. plz help me with the line

    $init = curl_init();


    it gives error as

    Fatal error: Call to undefined function curl_init();

    ReplyDelete
  14. Hi Mayank,

    you are getting boolean(false) because from google api v3 google doesn't return status which we are checking in function

    if (substr($response, 0, 3) === '200') {
    return $geo = explode(',', $response);

    so replace above code with this one

    if ($response!='') {
    return $geo = explode(',', $response);

    ReplyDelete
  15. Great job Done ! Thanks for sharing with us !

    ReplyDelete
  16. i got error

    Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\PicTraveler_new\branches\1.0.0\Implementation\system\core\Loader.php(829) : eval()'d code on line 257

    ReplyDelete