Grey box?

6,401 views
Skip to first unread message

DRS-Travis

unread,
Sep 30, 2009, 3:54:16 AM9/30/09
to Google Maps JavaScript API v3
Hi,

Im sort of new to the integration of Google maps and im trying out the
new V3 on my site, everything loads fine with no JS problems, however
I get a grey box. You can see this at http://www.warnesprojects.co.uk/contact-us.asp
- Clearly im missing something, however I have looked over the example
code many times and cannot see where I am at fault.

Any ideas?

Note: The buttons and Google logo load with no problem.

Brian Casey

unread,
Sep 30, 2009, 10:44:23 AM9/30/09
to google-map...@googlegroups.com

I think the declaration of the map variable has to be outside of the
initialize function:

<script ..>
var map;
function initialize {
...
map = new google.maps.Map(..);
}
</script>

--
Brian Casey
b...@goption.com

Marc

unread,
Oct 1, 2009, 9:02:57 PM10/1/09
to Google Maps JavaScript API v3
The problem is caused by the screen.css file:
div: { overflow: hidden; }

DRS-Travis

unread,
Oct 2, 2009, 2:55:40 AM10/2/09
to Google Maps JavaScript API v3
Marc,

I managed to figure that out, many thanks for your reply though!

justingarrett

unread,
Nov 23, 2009, 10:40:57 AM11/23/09
to Google Maps JavaScript API v3
On Sep 30, 7:54 am, DRS-Travis <t.hay...@drsolutions.co.uk> wrote:
> Hi,
>
> Im sort of new to the integration of Google maps and im trying out the
> new V3 on my site, everything loads fine with no JS problems, however
> I get agreybox. You can see this athttp://www.warnesprojects.co.uk/contact-us.asp
> - Clearly im missing something, however I have looked over the example
> code many times and cannot see where I am at fault.
>
> Any ideas?
>
> Note: The buttons and Google logo load with no problem.

Hi guys,

I have been trying to implement the new V3 API into my existing
website and I am seeing the same problem as DRS-Travis. I have double
checked that the div or parent divs do not have overflow: hidden and
it does not appear that they do.

Any other ideas please?

Thanks!

You can see a live version of the site here:

http://www.candyspacemedia.com/mapsapiv3/

arclyte

unread,
Nov 23, 2009, 12:56:21 PM11/23/09
to Google Maps JavaScript API v3
I'm not getting a map at all at that page. Looks like it's forwarding
to the home page... wrong url?


On Nov 23, 10:40 am, justingarrett <justin.garr...@candyspace.tv>
wrote:

justing

unread,
Nov 24, 2009, 10:44:40 AM11/24/09
to Google Maps JavaScript API v3
Hi arclyte,

Yes sorry, I omitted to include that you will need to browse to the
"contact page" as I cannot deeplink directly to it unfortunately.

Thanks!

justing

unread,
Nov 25, 2009, 6:52:36 AM11/25/09
to Google Maps JavaScript API v3
Sorry guys,

I just realised that I am not actually getting anything appearing at
all from the maps API - no grey box, no buttons... nothing :(

I am going to try and post a new thread but this did not seem to work
last time I tried but if anyone has any ideas in the mean time that
would be great!

Many thanks!

Susannah (Google Employee)

unread,
Nov 25, 2009, 5:26:19 PM11/25/09
to Google Maps JavaScript API v3
Hi Justin,

You need to give your map_canvas div a size.

The tutorial (http://code.google.com/apis/maps/documentation/v3/
introduction.html) states:
Note that the map will always take its size from that of its
containing element, so you must always set a size on that <div>
explicitly.

-Susannah

justing

unread,
Dec 3, 2009, 7:32:53 AM12/3/09
to Google Maps JavaScript API v3
Hi Susannah,

Thanks for pointing out that obvious mistake!! That is now resolved
thank you but I am still only seeing just the grey box and buttons.

Sorry guys, any other ideas?

Justin

On Nov 25, 10:26 pm, "Susannah (Google Employee)"
<susann...@google.com> wrote:
> Hi Justin,
>
> You need to give your map_canvas div a size.
>
> The tutorial (http://code.google.com/apis/maps/documentation/v3/
> introduction.html) states:
> Note that themapwill always take its size from that of its

Susannah (Google Employee)

unread,
Dec 4, 2009, 1:51:34 AM12/4/09
to Google Maps JavaScript API v3
Please include a link to your site.

Thanks,
Susannah

Esa

unread,
Dec 4, 2009, 7:37:09 PM12/4/09
to Google Maps JavaScript API v3


On Nov 23, 5:40 pm, justingarrett <justin.garr...@candyspace.tv>
wrote:

> I have double
> checked that the div or parent divs do not have overflow: hidden and
> it does not appear that they do.
>


But the parent div has display:none

<div id="contact" style="display:none; width:525px;">

That makes the size of the map_canvas div to be zero at the moment of
map initialization. API reads the map div size after initialization
only when you trigger 'resize' event

google.maps.event.trigger(map, 'resize')

Esa

unread,
Dec 5, 2009, 7:02:41 PM12/5/09
to Google Maps JavaScript API v3


On Nov 26, 12:26 am, "Susannah (Google Employee)"
<susann...@google.com> wrote:

> The tutorial (http://code.google.com/apis/maps/documentation/v3/
> introduction.html) states:
> Note that the map will always take its size from that of its
> containing element, so you must always set a size on that <div>
> explicitly.


But actually there is undocumented 'size' option in MapOptions.
Documenting that would solve troubles like this.

http://code.google.com/p/gmaps-api-issues/issues/detail?id=1997
Reply all
Reply to author
Forward
0 new messages