There is a method named 'checkResize()' which might help.
Notifies the map of a change of the size of its container. Call this method
after the size of the container DOM object has changed, so that the map can
adjust itself to fit the new size.
Call it after you attach you map to the DOM. I don't know why it
would be needed in your case, but its helped in similar cases in the
past.
2008/9/9 anglers <[EMAIL PROTECTED]>:
>
> More correctly to use some DIV element, f.e. with name 'mapstraction',
> and
> use such code:
> ...
> JavaScriptObject jso = getMap(DOM.getElementById("mapstraction"));
> ...
>
> protected native JavaScriptObject getMap(Element element)/*-{
> var m = new $wnd.Mapstraction(element, 'google');
> m.resizeTo(400,400);
> return m;
> }-*/
>
> But it is not solves the problem. Just gray rectangle on the screen,
> 400x400 px.
> Does anybody know what is the reason of such map behavior?
>
> Best regards
>
> On 8 сент, 19:59, anglers <[EMAIL PROTECTED]> wrote:
>> Hi all!
>>
>> I have some problem.
>> I`m trying to get Mapstraction functionality in my GWT application.
>>
>> In my main module I use this code:
>> ...
>> VerticalPanel ccc = new VerticalPanel();
>> ccc.setWidth("500px");
>> ccc.setHeight("500px");
>> JavaScriptObject jso = getMap( ccc.getElement());
>> RootPanel.get().add(ccc);
>> ...
>>
>> And JSNI function is:
>>
>> protected native JavaScriptObject getMap(Element element)/*-{
>> var m = new $wnd.Mapstraction(element, 'google');
>> m.resizeTo(400,400);
>> return m;
>>
>> }-*/;
>>
>> In result I have grey rectangle on the screen, "Powered by Google" and
>> "Terms of use" labels below.
>> Map is not loaded, just grey area
>>
>> Does anybody know what`s problem? Help me please to resolve this
>>
>> Best regards
>> Sergey
> >
>
--
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" 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-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---