Google map as BG not showing

So, I’m trying to get the google map to set it as a background on my test contact us page. http://www.connect4webdesign.com/maptest/

I’m getting a couple of errors in the js console, but I believe once I fix the first error that the others will be corrected.

This is the error message which I’m getting, “Uncaught SyntaxError: Unexpected end of input”

The error is related to the last line

jQuery(document).ready(function() {
 
 var mapOptions = {
    zoom: 4,
    center: new google.maps.LatLng(40.442157, -111.774539),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
  
[B]}[/B]

What is wrong here?

Out of interest why not just save the relevant part of the Google map as an image and use it as a background?

Missing closing bracket and semi-colon.

jQuery(document).ready(function() {
 
 var mapOptions = {
    zoom: 4,
    center: new google.maps.LatLng(40.442157, -111.774539),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
  
}); [COLOR="#FF0000"]<---- here[/COLOR]

I just see that it is the more modern thing to do on contact pages and I’m thinking that others are going to ask me to do it for the at some point so I thought I’d do it on my site first.

Thanks Pullo. That got the map to show and now I have to tweak a few css rules. I did try it with the semicolon, but forgot the parentheses #Doh. #NewTojQuery

No problems :slight_smile:

A good tool to catch errors like this is JSHint.
You copy and paste your code there and it will inform you of any errors it finds.