| | |
Google maps php/js help needed.
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
•
•
Join Date: May 2004
Posts: 102
Reputation:
Solved Threads: 0
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.
I am using a js script to control the map.
the map is currently located here. http://intweb.tech.bcuc.ac.uk/~20318...ject/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
php Syntax (Toggle Plain Text)
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 ' }, ];
PHP Syntax (Toggle Plain Text)
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/~20318...ject/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
Last edited by kained; Mar 19th, 2008 at 8:20 am.
If you found solution whould you mind to share with others?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: May 2004
Posts: 102
Reputation:
Solved Threads: 0
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.
It needed to be on one line rather then two, which is ridiculous!
php Syntax (Toggle Plain Text)
'name': 'Broadwick Street, W1 '
![]() |
Similar Threads
- City Portal Website (PHP)
- HiJack This Log -Spyware and Viruse- HELP (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: How i can do?
- Next Thread: image-code verification feature
| Thread Tools | Search this Thread |
action address advanced ajax apache api array auto autoincrement basics beginner broken cakephp class cms code codingproblem combobox cron curl database date datepart display domain dynamic email error errorlog file folder form format forms function functions google head href htaccess html image include includingmysecondfileinthechain interactive ip javascript job joomla js limit link load login malfunctioning masterthesis menu multiple mysql nodes oop outofmemmory paging password paypal pdf php popup problem procedure query ram random reference script search server sessions smarty source space sql stored syntax system table traffic tutorial unicode unset up-to-date upload url validation variable video web webapplications websitecontactform youtube






