Re: Map centering in ajax tabpanel
On Feb 23, 9:02 am, Manasa <manasa.pinap...@gmail.com> wrote:
> Hi!
>
> I have used ajax tab panel to dispaly the map. But it is not getting
> centered at the given point. So I searched this groups and found the
> following code
>
> container = document.getElementById("GoogleMap_Div");
> width = parseInt(container.style.width);
> height = parseInt(container.style.height);
> map = new GMap2(container, {size:new GSize(width,height)});
>
> This is working. But I have given the map width as 100%. But it is
> taking only 100px.
That's because parseInt("100px") and parseInt("100%") both give a
value of 100, which you're passing to GSize. GSize takes its
parameters in pixels. What you may need to do is to use checkResize()
when you unhide the tab so that the API will get the map size for
itself.
> Due to some reasons I can't fix the map width, I
> found the following link in a post
>
> http://econym.googlepages.com/basic19.htm
Searching the group for "basic19" would give the current url:
http://econym.org.uk/gmap/basic19.htm (Googlepages was closed some
time ago)
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home