0

Bug in gmaps 2.0.50 canvas destroyed when map was invisible

asked 2010-01-09 08:50:22 +0800

timo18146 gravatar image timo18146
189

updated 2010-01-09 08:52:50 +0800

try this in the demo and see what I mean. Tried in IE8 winXP and FF3.5.5 Ubuntu. Klick the top-button and try to pan/move the map around.

The map is initialized invisible and set visible on buttoinclick. Canvas then is only 1/3 to half initialized.


<window title="Google Maps">
	<div style="border: 1px solid red;margin-top:10px;margin-bottom:20px"
	if="${empty sessionScope.gmapsKey}">
		To use Google Maps for this site, you have to assign a proper key first.
		Check the source codes of org.zkoss.zkdemo.userguide.MainWindow for details.
	</div>
	<vbox>
        <button label="Set Map visible for bug demonstration" onClick="mymap.setVisible(true);" />
	<gmaps id="mymap" width="700px" height="500px" visible="false" showSmallCtrl="true">
		<attribute name="onMapMove">
			mylat.setValue(self.getLat());
			mylng.setValue(self.getLng());
		</attribute>
		<attribute name="onMapZoom">
			myzoom.setValue(self.getZoom());
		</attribute>
		<attribute name="onMapClick">
			Gmarker gmarker = event.getGmarker();
			if (gmarker != null) {
				gmarker.setOpen(true);
			}
		</attribute>

		<ginfo id="myinfo" open="true">
			<attribute name="content">
				Hello, <a href="http://www.zkoss.org">ZK</a>.
			</attribute>
		</ginfo>
		
		<gmarker id="mymark" lat="37.4410" lng="-122.1490">
			<attribute name="content">
				Hello, <a href="http://www.zkoss.org">ZK</a> on top of Gmarker.
			</attribute>
		</gmarker>
	</gmaps>
	<grid><rows>
		<row>Latitude: <doublebox id="mylat" value="${mymap.lat}" onChange="mymap.panTo(self.doubleValue(), mymap.getLng())"/></row>
		<row>Longitude: <doublebox id="mylng" value="${mymap.lng}" onChange="mymap.panTo(mymap.getLat(), self.doubleValue())"/></row>
		<row>Zoom Level: <intbox id="myzoom" value="${mymap.zoom}" onChange="mymap.setZoom(self.getValue())"/></row>
		<row>Open Info: <button label="Change" onClick="myinfo.isOpen() ? mymark.setOpen(true) : myinfo.setOpen(true)"/></row>
	</rows></grid>
	</vbox>
</window>
			

I'll file this this one in SF.net. The bug seems to be in all ZK5 gmapsz. not only 2.0.50

Timo

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2010-01-10 21:41:29 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

We will track the posted bug.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-01-09 08:50:22 +0800

Seen: 540 times

Last updated: Sep 17 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More