henrichen / zkgmapsz

Automatically exported from code.google.com/p/zkgmapsz
0 stars 0 forks source link

Supports vflex/hflex #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://tracker.zkoss.org/browse/ZK-170
or
https://sourceforge.net/tracker/?func=detail&aid=3168756&group_id=152762&atid=78
5191

gmaps

Summary of forum thread: http://www.zkoss.org/forum/listComment/14985

How can I get the map to fill the available space?
I've tried to specify size in div containers, and even borderlayout, without 
much luck. Always seems to want an absolute height specified somewhere in the 
hierarchy.

<?page id="gmap_page" contentType="text/html;charset=UTF-8"?>
<zk xmlns:h="http://www.w3.org/1999/xhtml">

<script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key=..." 
type="text/javascript"></script>

<window id="winGMap" border="none" vflex="1" apply="ui.map.GMapController">
<gmaps id="gmap" showTypeCtrl="true" showSmallCtrl="true" style="position: 
relative;" width="100%" height="250px">
<attribute name="onMapClick"><![CDATA[
org.zkoss.gmaps.Gmarker gmarker = event.getGmarker();
if (gmarker != null)
gmarker.setOpen(true);
]]></attribute>
</gmaps>
</window>
</zk>

Could not get vflex="true" to have any effect on the map. (Shouldn't that be 
vflex="1"? I tried both to be sure.)
The only way I can get any control of the height is by setting height to an 
absolute value in either the tabpanel, window or gmaps tag. (Indicated by ***px 
below.)
Percentage values and flex tags just do not seem to work at all.

...
<tabpanels>
<tabpanel id="pnlMap" height="***px">
<include src="map/tab_google_map.zul" />
</tabpanel>
...
In tab_google_map.zul

...
<window id="winGMap" border="none" apply="com.tcs.gla.ui.map.GMapController" 
height="***px">
<gmaps id="gmap" showTypeCtrl="true" showSmallCtrl="true" style="position: 
relative;" width="100%" height="***px">
...

Tried using onClientInfo event to resize.
This almost worked, but unfortunately, only after the browser was resized 
manually (or in the case of a mobile device, rotated). The interface was not 
sized on initialization in the way I was hoping. The maps control was correctly 
sized, but the map panels inside thought they were constrained by the original 
dimensions. The user had to resize the browser manually to force the Map 
control to use its new container dimensions.

Original issue reported on code.google.com by simon....@gmail.com on 19 Jul 2011 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by benbai...@gmail.com on 19 Jul 2011 at 4:43

GoogleCodeExporter commented 9 years ago

Original comment by benbai...@gmail.com on 19 Jul 2011 at 4:54

GoogleCodeExporter commented 9 years ago
Hi Red3software,

I tested the vflex with the code below at zksandbox and it works fine,

<window width="500px" height="500px">
<gmaps hflex="true" vflex="true" />
</window>

Original comment by benbai...@gmail.com on 20 Jul 2011 at 7:35

GoogleCodeExporter commented 9 years ago
correction:

Comment 1 is just fit the 'work' scenario,
its true that it will not work in some scenario.

Original comment by ben...@potix.com on 23 Jul 2011 at 6:58

GoogleCodeExporter commented 9 years ago

Original comment by benbai...@gmail.com on 24 Feb 2012 at 7:14

GoogleCodeExporter commented 9 years ago
Ready since 2012-02-24.

Original comment by benbai...@gmail.com on 3 Mar 2012 at 2:32