| | |
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 |
advanced alerts apache api archive array autosuggest beginner binary broken cakephp checkbox class clients cms code cron curl database date datepart display dynamic echo email emptydisplayvalue eregi error execute explodefunction file files folder form forms function functions google hack head href htaccess html if...loop image include insert ip javasciptvalidation javascript joomla keywords library limit link login mail matching menu mlm multiple mysql number object oop password paypal pdf php phpincludeissue query radio random recursive remote script search searchbox server sessions shot smarty source space speed sql syntax system table tutorial update upload url validator variable vbulletin video web website youtube






