I am making a website to show Londoners where the nearest toilet to them is. I am having problems getting the data into the google maps application. It was working yesterday and now it isn't. Im confused to say the least any help would be much appreciated.

var markers = [
{
'latitude': 51.51383,
'longitude': -00.15246,
'name': 'Balderton street, W1'
},
{
'latitude':  51.51504,
'longitude': -00.15039,
'name': 'Barrett Street, W1'
},
{
'latitude':  51.51015,
'longitude': -0.18692,
'name': 'Bayswater Road, W2'
},
{
'latitude':  51.52113,
'longitude': -00.20921,
'name': 'Bevington Road, W10 '
},


{
'latitude':  51.51626,
'longitude': -00.18732,
'name': 'Bishops Bridge Road, W2'
},
{
'latitude':  51.49681,
'longitude': -00.14168,
'name': 'Bressenden Place, SW1'
},

{
'latitude':  51.51360,
'longitude': -00.13581,
'name': 'Broadwick Street, 
W1 '
},
{
'latitude':  51.50966,
'longitude': -0.08036,
'name': 'Byward Street,EC3'
},
{
'latitude':  51.53890,
'longitude': -00.14287,
'name': 'Camden High Street 176, NW1' 
},
{
'latitude':   51.46475,
'longitude': -00.16845,
'name': 'Clapham Junction/Station Approach, SW11 ' 
},
{
'latitude':   51.51149,
'longitude': -00.12346,
'name': 'Covent Garden, next to St Pauls church, WC1 ' 
},

];

I am using a js script to control the map.

var centerLatitude = 51.604372;  //longittude and latitude coordinates and zoom geocodes
var centerLongitude = -0.159052;
var startZoom = 13;
var description = 'London';
 
function addMarker(latitude, longitude, description) {
var marker = new GMarker(new GLatLng(latitude, longitude));
 
GEvent.addListener(marker, 'click',
function() {
marker.openInfoWindowHtml(description);
}
);
 
map.addOverlay(marker);
}
 
function init() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);
 
for(id in markers) {
addMarker(markers[id].latitude, markers[id].longitude, markers[id].name);
}
}
}
 
window.onload = init;
window.onunload = GUnload;

the map is currently located here. http://intweb.tech.bcuc.ac.uk/~20318219/project/index.php

any help woul;d be much appreciated or if you need more to help me lemme know. This is nowhere near finished so am not bothered by lack of funcationality or anything like that im just trying to get the markers onto the map at the moment.

dave

If you found solution whould you mind to share with others?

Fair enough. It was a silly little thing. line 39 of the php code. Just moved it up to line 38 and all was well.

'name': 'Broadwick Street, 
W1 '

It needed to be on one line rather then two, which is ridiculous!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.