Jump to content

Google Maps API v3 - Iterated Markers - Help!


michaeldrayson

Recommended Posts

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

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.