DMXzone Google Maps Support Product Page

Not a problem

Google Maps and multiple fields on recordset

Reported 01 Feb 2012 09:58:52
1
has this problem
01 Feb 2012 09:58:52 HERNAN MONTERO posted:
Hi, I have the address (street number and street name) on a separate field, then the city is on another field and the state and zip codes are on another fields. Basically to pull up a full address I need a recordset with those 4 fields. Now problem is that Google Map extension only work with one field. It forces me to reload all my addresses (street number, street name, city, state and zip code) on the same address field. Is there a way I can use what I have and enter them in like this:
<?php echo $row_rsMyRecordset['address']; ?>,<?php echo $row_rsMyRecordset['city']; ?>, <?php echo $row_rsMyRecordset['state']; ?>, <?php echo $row_rsMyRecordset['zipcode']; ?>

Thanks.

Replies

Replied 01 Feb 2012 10:01:01
01 Feb 2012 10:01:01 Teodor Kuduschiev replied:
Hello,

Unfortunately it is not possible. Google Maps extension requires one field for the address.
Replied 09 Feb 2012 16:08:58
09 Feb 2012 16:08:58 Tom OBrien replied:
I ran into the same thing. I handled it with the query like this:
SELECT concat(Address,' ' ,City,',' ,zState,' ' ,Zip) AS fulladdr, etc.........
Replied 09 Feb 2012 17:21:50
09 Feb 2012 17:21:50 HERNAN MONTERO replied:
Hey Tom, thanks for stepping back into this!. This morning I finally got it to work using exactly the same solution. Thanks for sharing though! I have also gone further and added some styling to the HTML section by using styles and divs to lay out phone, email, logos, colors, etc. Now it looks like this:

<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(
function()
{
jQuery("#map1".gMap(
{width:600, height:400, zoom:10, markers:[<?php
do {
?> {address:"<?php echo $row_rsLocations['newaddress']; ?>", html:"<div id='google' style='margin: 0px;padding: 8px;height: 110px;width: 260px;background-color: #F2F2F2;'><div id='centering' style='width:250px;margin-left: auto;margin-right: auto;margin-top:9px;'><img src='assets/images/logos/<?php echo $row_rsLocations['BusinessLogo']; ?>' width='60' align='left' style='border:0; padding-top: 0px;padding-right: 0px;padding-bottom: 30px;padding-left: 0px;display: block;float: left;margin-top: 0px;margin-right: 9px;margin-bottom: 10px;margin-left: 0px;'/><p style='font-family: Georgia;font-size: 13px;font-weight: bold;color: #333;margin:0;padding:0;width:250px;'><?php echo $row_rsLocations['Name']; ?></p><p style='font-family: Georgia;font-size: 12px;font-weight: normal;color: #333;margin:0;padding:0;width:250px;'><?php echo $row_rsLocations['Description']; ?></p><p style='font-family: Georgia;font-size: 12px;font-weight: normal;color: #333;margin:0;padding:0;width:250px;'><em><?php echo $row_rsLocations['newaddress']; ?></em></p><p style='font-family: Georgia;font-size: 11px;font-weight: bold;color: #333;margin:0;padding:0;text-decoration:none;'><a href='maps.google.com/maps?saddr=&daddr=<?php echo $row_rsLocations['newaddress']; ?>' target='_blank'><img src='assets/images/icons/getdirections.png' width='110' align='left' style='border:0; padding:0;margin-top:3px;margin-left: 0px;'></a></p></div></div>", title:"Business Cloud <?php echo $row_rsLocations['IDBusiness']; ?>", icon:{image:"assets/images/icons/markerCloud3.png", shadow:"assets/images/icons/markerCloudShadow3.png", iconsize:[65, 49], shadowsize:[65, 49]}}, <?php
} while ($row_rsLocations = mysql_fetch_assoc($rsLocations));
?>], panControl:true}
);
}
);
// ]]>
</script>
Replied 09 Feb 2012 18:41:14
09 Feb 2012 18:41:14 Tom OBrien replied:
Can you post a link to your site so that I can see the styling? I don't have a lot of time to work on my maps but I'd like to get the infobubbles to look like the info on this site.
www.realestate.com.au/buy/in-inner+west%2c+nsw/map-1

Thanks.
Replied 09 Feb 2012 19:26:00
09 Feb 2012 19:26:00 HERNAN MONTERO replied:
I'm still working on this, so there's no page to look at, but here is a screenshot: www.bailarinesdetango.org.ar/maps.png

And that map is using exactly the code you see there. Looks good?

Reply to this topic