Google Map Not Showing

Hello,

I have a page that I believe should be displaying a Google map but isn't.  I believe the XML data is in place, but I've obviously done something wrong...!

Please take a look at www.villasdirect.com/top-destinations.asp

Thanks in advance!
Nico2011Asked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
OK. Couple more points (i've got this working with your code so it should be good):

1) You are using JQuery syntax in a couple of places, but don't have a reference to the API. So, you need to add the following into the head section of the page:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

Open in new window

That's the CDN version, you can download it and reference it locally if you prefer.

2) There are a couple of lines that are causing a javascript error. Namely:
document.getElementById("autolng").value = autolng;
document.getElementById("autolat").value = autolat;

Open in new window

Elements called "autolng" and "autolat" don't appear to exist (or not in your cutdown version at least).

Finally, you have a reference to the Maps API in your page twice - this won't break anything, but you should remove one of them.
0
 
Carl TawnSystems and Integration DeveloperCommented:
Well, according to my javascript console, your XML file is invalid. Having a closer look at the XML, it appears to be all of the "&nbsp;" values in there that are causing the issue.

How are you generating the XML?
0
 
Nico2011Author Commented:
Hi Carl,

Thanks for your help - not quite there yet though.

I have cleaned up the XML - the &nbsp;'s were there as the town attribute was empty, so I did that intentionally, but now I have removed anything not necessary (including town), but it still doesn't quite click...

Best wishes/Nico
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Carl TawnSystems and Integration DeveloperCommented:
It appears you also have an encoding issue. You don't have an XML declaration in your document so it is using the default UTF-8 character set - and some of you data must be using something not included in the set.

Try adding this to the start of you XML:

<?xml version="1.0" encoding="iso-8859-1"?>

Open in new window

0
 
Nico2011Author Commented:
nope - didn't do it either...

I have now tried to minimise all the other data on the page so we can get to the root of the issue.  

This simplified page can be seen here: http://www.villasdirect.com/deps/country-map.asp?country=greece

I'm sure I've done something stupid though...
0
 
Nico2011Author Commented:
Thanks so much Carl - it was the autolng/autolat causing a javascript error that stopped it working...!
0
All Courses

From novice to tech pro — start learning today.