Ok, looking at the sources, I found that WicketStuff adds a
WebMarkupContainer which is used for the actual map. Unfortunately, it
hides this object from its client code, so there's no way to access it
and call "gmap2container.getMarkupId()". It does however assign the
class "gmap" to the container. So I got around this using this ugly hack:
myDialog.setOpenEvent(JsScopeUiEvent
.quickScope(
"var mapCtrl = $('.gmap').attr('id');\n" +
"dom.getElementById(mapCtrl).checkResize();"
)
);
Works if there's only one map in the page...
On 16/5/2010 15:55, Alexandros Karypidis wrote:
Hi,
I am unsing GMap2 from WicketStuff
(http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-gmap2)
and need to display a map in a pop-up dialog. I use JQuery for the
dialog. When the Dialog comes up, the map's viewport is offset in
relation to the window and only the cross-section of the map's
position (starting outside the dialog window) and the actual pop-up
window is being drawn. For example, assume the map starts at absolute
position 0,0 with as size of 600,400 and the dialog is shown at
absolute position 300,200 with size 600,500: Only the region (300,200
-> 600,400) is drawn.
This is probably because the dialog is not shown when the GMap2
javascript calculates its position, so I need to call the
"checkResize()" method on
http://code.google.com/apis/maps/documentation/reference.html#GMap2
that is created by the WicketStuff control. Problem is, I can't get to
the Javascript object underlying the wicketstuff representation. I'm
trying to do something like:
myDialog.setOpenEvent(JsScopeUiEvent
.quickScope(
"alert('fixing map size');\n" +
" $('#mapObjectId').checkResize();\n"
);
How can I get the proper "mapObjectId" value?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]