clausowitz Posted July 21, 2012 Share Posted July 21, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/266042-show-google-maps-on-webpage/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.