Batch google Geo-coding

Discussion in 'JavaScript' started by JamesFarrell, Jan 29, 2009.

  1. #1
    I have a working version of google's geo-coding tutorial:
    http://propertysteps.ie/site-test/geocode.htm

    I need to loop through a mysql database and save the co-ordinates for a numbe of addresses.

    I had hoped to take the geocode function call out of a onclick event:
    <form action="#" onsubmit="showAddress(this.address.value); return false">
    Code (markup):
    to something like a php call like:
    echo "<script onload=\"showAddress($listing_address);\"> </script>";
    Code (markup):
    That way I could put the <script onload call inside a php loop for the returned databset like so:
    <p>Listing address is The Hills</p>
    <script onload="showAddress('The Hills');"> </script>
    Code (markup):
    This doesn't seem to work anyone know why?

    If I can get that working, I would then be able to update the database using Ajax yes?

    Am I going about this the wrong way? Anyone have any ideas of advice?
     
    JamesFarrell, Jan 29, 2009 IP
  2. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hi James,
    not sure if it solves all, but first catch - echo "<script onload=\"showAddress($listing_address);\"> </script>";
    should be echo "<script onload=\"showAddress('$listing_address');\"> </script>";
    as you want to pass string.
    If still nothing, can you see some error??
     
    lp1051, Jan 30, 2009 IP