Jump to content

show google maps on webpage


clausowitz

Recommended Posts

I show addresses on a webpage and want to show the locations on a small map.

I have a javascript function for the maps using Google Api 3. The function is working but I have no idea to show it in my php-loop. Maybe it's not possible due to the difference in javascript and php.

        while($row = mysql_fetch_array($sql)) {

        $id = $row["id"];
        $name = $row["name"];
        $spec = $row["specialism"];
        $address = $row["address"];
        $telephone = $row["telephone"];
        $lat = $row["lat"];
        $lon = $row["lng"];
        $loc = "$lat $lon";
        if(($lat > '0') && ($lat > '0')) {

}

$outputList .= '<table cellspacing="0" bgcolor="#FFFFFF" border="0"><tr>
<td colspan="2" class="boardHeader" style="padding-left: 6px;">' . $name . '</td>
<td class="boardHeader" style="color:#3300CC; padding-left:6px; padding-right:2px; font-weight:bold" align="right">' . $spec . '</td>
</tr>
   <td> </td>
   <td valign="left">  </td>
   <td rowspan="4"><div id="map_canvas-<?php echo $num2++; ?>" style="width:200px; height:150px">';
   echo "javascript:GetMedicalMap($lat,$lon);";

$outputList .= '</div></td>
</tr>
<tr>
   <td style="padding-left: 6px;">Address:</td>
   <td colspan="1" style="vertical-align:middle" width="42%" >' . $address . ' </td>
</tr>
<tr>
   <td style="padding-left: 6px;">Telephone:</td>
   <td >' . $telephone . '</td>
</tr>
<tr>
    <td >  </td>
    <td >  </td>
</tr><br />
';
        }

 

thanks for any advise,

Marco

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.