As code blow, you will see "true, true" when you click on a gmarker to close
it, this is wrong.
<zk xmlns:w="client">
<gmaps lat="22" lng="22" width="500px" height="500px">
<attribute name="onMapClick"><![CDATA[
import org.zkoss.gmaps.Gmarker;
Component target = event.getReference();
if (target instanceof Gmarker) {
Gmarker m = (Gmarker)target;
System.out.println(m.isOpen());
System.out.println(m.getContent());
if (m.getContent() != null
&& !m.isOpen()) {
m.setOpen(true);
} else if (m.isOpen()) {
alert(m.isOpen());
m.setOpen(false);
alert(m.isOpen());
}
}
]]></attribute>
<gmarker lat="22" lng="22"
content="marker content" open="true" />
<gmarker lat="22.03" lng="22.03"
content="marker content 2" />
</gmaps>
</zk>
Cause:
Legacy code Ginfo#isOpen did not updated properly,
https://code.google.com/p/zkgmapsz/source/browse/trunk/gmapsz/src/org/zkoss/gmap
s/Ginfo.java#135
How to fix:
Ginfo#isOpen should simply return the value of _open instead of check info of
map
Original issue reported on code.google.com by benbai...@gmail.com on 10 Sep 2013 at 1:58
Original issue reported on code.google.com by
benbai...@gmail.com
on 10 Sep 2013 at 1:58