I have some problems with my code, I have a list of airports in the sql database, and I want to create tokens for each of these airports.
For the address I received ICAO codes for each airport, ICAO is unique for each airport
I get data from a database as an array
it is saved in "temp" using the split function and using for-loop gets them 1 on 1
Geocoding is not a problem, but I don’t know why for TITLE and the click event it is always the last of the array used.
here is the page, the last entry in the database is ZBAA.
And all the markers are placed in the right place, but the title is wrong: s
http://mizar.lte.lu/~pr1011_meteo/projet/cartemonde4.php
The problem with the "address", I think, but I'm not sure.
for (var i = 0; i < temp.length; ++i){ var address=temp[i]; geocoder.geocode({ 'address': address}, function(results){ var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, title:address }); google.maps.event.addListener(marker, 'click', function() { window.open ('infomonde.php?icao='+address+'&language=fr', 'Informations météo', config='height=400, width=850, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')}); }); };