michaeldrayson Posted December 28, 2011 Share Posted December 28, 2011 Hello all, I am a relative newbie, and have been recently trying to get to grips with the Google Maps v3 API. I'm hoping someone here will be kind enough to take pity and help me with some difficulty I am having. First, let me set the scene. I'm helping a friend develop a website for a hobby. It's a simple, PHP / MySQL based site which lists different establishments. There is a database of companies, which includes a name, address, long lats, etc. I have managed to write the SQL query to poll the database, and return a list of markers on a map of London: http://datanalyst.co.uk/dev/flmap/mapexample7a.php However, I am getting confused regarding the markers, it would seem like my code (which can be found below) is iterating through all of the companies, and then setting just one marker for all points? The code can be found at http://paste.bradleygill.com/index.php?paste_id=348277 I am hoping you can see what I'm doing here. The PHP script is printing HTML / JavaScript code to the page, which includes a foreach loop, which grabs the long lats and puts them into google.maps.LatLng I am just just struggling with the markers - and I cannot see where I've gone wrong! Thanks so much in advance for any help you can provide me! All the best, and Merry Christmas, Michael Quote Link to comment https://forums.phpfreaks.com/topic/253976-google-maps-api-v3-iterated-markers-help/ 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.