1

I am trying to use the google maps api. The only problem is that the map won't show all I get is a gray box.

here is the code:

function initialize() { var map_canvas = document.getElementById('map_canvas'); var mapOptions = { center: new google.maps.LatLng(33.748995, -84.387982), zoom: 8, mapTypeId: google.maps.MapTypeId.TERRAIN } var map = new google.maps.Map(map_canvas); } google.maps.event.addDomListener(window, 'load', initialize) 

here is the css:

#map_canvas { max-width: 1040px; height: 400px; } 

1 Answer 1

3

You forgot to pass the mapOptions as 2nd argument:

var map = new google.maps.Map(map_canvas,mapOptions); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.