2

I just can't seem to get Google Maps API to work on Wordpress site. I've written the code for a map with polylines, markers and infowindows. I've decided to write my code rather than use a plugin as I also want to include a seperate streetview div and elevation chart div.

All works without a hitch when I load the HTML/Javascript file from my computers hard drive to Safari.

However, I can't seem to load the file into Wordpress. I loaded the .js file via an FTP client into a new folder I created called 'scripts' within the public_html folder. I then referenced the file via header.php file but no luck. I've also tried referencing the file into the actual post and footer.php file - still no luck.

I wonder whether it is down to anyone of the following problems: 1. Not calling the right functions within the Wordpress page or post. 2. As I am using a multisite install perhaps I am not using the right url to call the .js file. 3. The Google Maps API javascript libraries not being called correctly.

I have tried putting all the Javascript code in the actual page. It works but the infowindows and streetview has formatting issues that effects the functionality of the map. And besides, it makes for a very bloated post!

If anyone has any ideas it would be truly appreciated. I've been trying to troubleshoot for a while now and I think I have reached the level at which my knowledge can't help anymore!

Many thanks

4

0 回答 0