I am currently following this guide at Google developers.
https://developers.google.com/maps/articles/phpsqlajax_v3?hl=en-EN#createmap
I am adding a map on my website with geocoded entries. Each entry into the table is a business. Each entry/business currently has a field/column for
(name
, address
, lat
, lng
, type
, url
)
Screenshot Here http://postimg.org/image/3z8kcwq4b/
I was able to add the url
field and it be displayed properly on the map markers. I need to be able to also add two more fields. 1 for 'phonenumber' and one for 'description.
the purpose of the above entries into the database is that when they click a marker on the map of an entry/business it will display information about that business. I can't get it to show this information when clicked. The code that I believe to be relevant to my issue is below.
here is the code I currently have.
Main Page:
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var url = markers[i].getAttribute("url");
var type = markers[i].getAttribute("type");
var point = new google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var html = '<a href="' + url + '">' + name + '</a> <br/>' + address + ' <br/>' ;
phpsqlajax_genxml2.php
echo 'name="' . parseToXML($row['name']) . '" ';
echo 'address="' . parseToXML($row['address']) . '" ';
echo 'lat="' . $row['lat'] . '" ';
echo 'lng="' . $row['lng'] . '" ';
echo 'type="' . $row['type'] . '" ';
echo 'url="' . $row['url'] . '" ';
echo '/>';
I need to be able to add more info into the database so i can make the map call it. I would like for it to display a phone number and description when they click the map marker for that business.
(the above code pulls data from the tables on the database and displays the url of the business, the name of it, it's long/lat-geocoded, and it's address.)
I have been able to completely add this into my site except for this. Last thing i'm stuck on.