Map not populating Div

76 views
Skip to first unread message

BeanoKing

unread,
Jul 18, 2010, 9:08:02 PM7/18/10
to Google Maps JavaScript API v3
Here's the link to the map: http://www.ottolawyers.com Then click
on the Address tab

You can see that the map is not rendering fully.

Here's my script code:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false"></script>


<script type="text/javascript">
function initialize() {

var latlng = new google.maps.LatLng(41.7070, -93.063);
var myOptions = {
zoom: 15,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("mapCanvas"), myOptions);

var markerLatLong = new google.maps.LatLng(41.6984,
-93.0571); //41.6989, -93.0695)

var marker = new google.maps.Marker({
position: markerLatLong,
map: map,
title: "Otto Law Office"
});
}

</script>

I'm using the document ready jQuery function to call the initialize
function.

Not sure what to do. It was working in Visual Studio when I was
running it on my localhost. After I deployed to the hosting company,
all hell went loose with the map.

Thanks

Ralph Ames

unread,
Jul 18, 2010, 11:08:03 PM7/18/10
to google-map...@googlegroups.com
>Here's the link to the map: http://www.ottolawyers.com Then click
>on the Address tab

Search the Group for resize.


Ralph
-
www.easypagez.com/maps/map_index.html
www.easypagez.com/maps/v3_basicmap.html

--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to
google-maps-js-a...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

BeanoKing

unread,
Jul 19, 2010, 10:52:31 AM7/19/10
to Google Maps JavaScript API v3
I searched for resize. It seems like I need to add a listener. I
have done that and still no luck.

If I manually resize the browser, it works. But the jscript code is
not doing anything to the map. I just need a concrete answer on this
is supposed to work.

Map at: http://www.ottolawyers.com

Thanks in advance for any help

On Jul 18, 10:08 pm, Ralph Ames <ralph.a...@gmail.com> wrote:
> >Here's the link to themap:  http://www.ottolawyers.com  Then click

geoco...@gmail.com

unread,
Jul 19, 2010, 10:58:51 AM7/19/10
to Google Maps JavaScript API v3
On Jul 19, 7:52 am, BeanoKing <cardinalb...@gmail.com> wrote:
> I searched for resize.  It seems like I need to add a listener.  I
> have done that and still no luck.
>
> If I manually resize the browser, it works.  But the jscript code is
> not doing anything to the map. I just need a concrete answer on this
> is supposed to work.
>
> Map at:http://www.ottolawyers.com

Works for me in IE6.

-- Larry

>
> Thanks in advance for any help
>
> On Jul 18, 10:08 pm, Ralph Ames <ralph.a...@gmail.com> wrote:
>
>
>
> > >Here's the link to themap:  http://www.ottolawyers.com Then click
> > >on the Address tab
>
> > Search the Group for resize.
>
> > Ralph
> > -www.easypagez.com/maps/map_index.htmlwww.easypagez.com/maps/v3_basicm...
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-maps-js-a...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -
>
> - Show quoted text -

BeanoKing

unread,
Jul 19, 2010, 11:06:05 AM7/19/10
to Google Maps JavaScript API v3
Does not work in Chrome or IE 8

On Jul 19, 9:58 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> > > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

BeanoKing

unread,
Jul 19, 2010, 3:43:16 PM7/19/10
to Google Maps JavaScript API v3
Anybody?
> > > > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequoted text -

Rossko

unread,
Jul 19, 2010, 4:12:16 PM7/19/10
to Google Maps JavaScript API v3
You map is built in an initially hidden div. That means its size is
indeterminate. Later, when the map is revealed by clicking the tab,
the tiles and positions work badly because of the indeterminate size.

One approach is to run the map's resize method in your tabs code that
reveals the map, after its div is un-hidden.

Or give the map div some solidly defined width and height (not %)

BeanoKing

unread,
Jul 20, 2010, 10:07:40 AM7/20/10
to Google Maps JavaScript API v3
That worked! I call the resize function when the tab is clicked.
Thanks for your help

On Jul 19, 3:12 pm, Rossko <ros...@culzean.clara.co.uk> wrote:
> Youmapis built in an initially hiddendiv.  That means its size is
> indeterminate.  Later, when themapis revealed by clicking the tab,
> the tiles and positions work badly because of the indeterminate size.
>
> One approach is to run themap'sresize method in your tabs code that
> reveals themap, after itsdivis un-hidden.
>
> Or give themapdivsome solidly defined width and height (not%)
Reply all
Reply to author
Forward
0 new messages