On Dec 8, 7:42 am, LZ <[email protected]> wrote:
> Hi Larry,
> thank you for the reply and sorry if I took so long to reply.
>
> I am not sure where:
> 1) use the size option

See the documentation:
http://code.google.com/apis/maps/documentation/reference.html#GMap2
and
http://code.google.com/apis/maps/documentation/reference.html#GMapOptions

In the line that creates your GMap2 object:
var map = new GMap2(jQuery("#map").get(0));

add { size: new GSize(400,400) } (or whatever the size of your map div
is)

var map = new GMap2(jQuery("#map").get(0), { size: new GSize
(400,400) } );

(buyer beware, totally untested)

> 2) call the checkResize() function.

I don't know the flow of your program, or JQuery.  You need to call it
after the div is displayed and the browser is capable of returning its
true size.

  -- Larry

>
> I understand the issue is due to the map size. But since the map is
> created via jQuery in a container tab which includes the map creation
> page, I am not sure where to put the resizing code... (you can have a
> look at the test1.html source code and then the test2.html in order to
> understand better what I am trying to explain; the tes2.html is not
> working alone, because the inclusions of the google map api is on the
> test1.html).
>
> Regards.
> LZ
>
> On Dec 4, 11:20 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Dec 4, 12:42 pm, LZ <[email protected]> wrote:
>
> > > Hi there,
> > > I am quite new with jQUery and the jsapi of google maps.
>
> > > I have got an issue, I don't know what is causing it.
>
> > > Please go to:http://www.localizziamo.it/maptest/test1.html
>
> > I get the "This web site needs a different Google Maps API key. ..."
> > at that URL, but the map does work.
> > That message is because of this line:
> > <script type="text/javascript" src="http://www.google.com/jsapi?
> > key=YOUR_KEY"></script>
> > YOUR_KEY is not a valid key...
>
> > The map I see has the typical symptoms of a map which is created when
> > the div containing it has zero size.
> > Either use the size option when you create the GMap2 
> > objecthttp://code.google.com/apis/maps/documentation/reference.html#GMapOpt...
>
> > or call map.checkResize() after it is displayed and the browser can
> > return its actual 
> > size.http://code.google.com/apis/maps/documentation/reference.html#GMap2.c...
>
> > > then click the "map" tab: you will see the content of the tab "map"
> > > loaded via jQuery. The map is loaded but it is not centered. The
> > > marker is there but not at the center of the map. Can anyone help me
> > > please?
>
> > > If you need to have a look at the code of the map page included into
> > > the main page, then go to
>
> >http://www.localizziamo.it/maptest/test2.html
>
> > That URL gives me a javascript error...
>
> >    -- Larry
>
> > > Regards,
> > > LZ- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--

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


Reply via email to