0

I'm having trouble with the Google Maps JS library just showing a gray box.

I'm not doing anything other than the code that Google has given in their own tutorial so I'm not sure what's wrong here.

You can see my code here: https://gist.github.com/anonymous/e0b6fa81a57ce082eb5d

I've looked over a bunch of other questions and still don't know exactly why this is happening.

Any thoughts?

Chris R.
  • 699
  • 8
  • 23
  • What sets the map size? What is in styles.css? – geocodezip Feb 06 '15 at 01:46
  • The only thing in styles is #map-canvas{ width: 100%; height: 300px; } Even without that and adding it directly to the canvas tag I get the same thing. – Chris R. Feb 06 '15 at 01:46
  • 1
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it **in the question itself**. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – geocodezip Feb 06 '15 at 01:48
  • What is that 100% of? Do you get a map if you use a fixed size? – geocodezip Feb 06 '15 at 01:48
  • 100% of the column width (Bootstrap col-md-8) And no, no map if it's fixed. Still just the gray box. – Chris R. Feb 06 '15 at 01:49
  • And what sets the width of bootstrap col-md-8? – geocodezip Feb 06 '15 at 01:50
  • Bootstrap. It's a dynamic width. That said, I tried removing Bootstrap entirely and have only the canvas element on the page, no styles or anything, and the response is the same. – Chris R. Feb 06 '15 at 01:52
  • @Mark are you getting some error on console? like `offset width of null`? or something? – Ethaan Feb 06 '15 at 03:16
  • just for test purposes change `` to `
    `
    – Ethaan Feb 06 '15 at 03:22

1 Answers1

0

You'd better not use canvas tag to encapsulate a google map unless you want to just get a screenshot of the map, like this project

Also there is nested div tag issue with google map

Community
  • 1
  • 1
Zhenyi Luo
  • 61
  • 5