0

Gmarker OnClick in Java .

asked 2012-03-26 08:07:40 +0800

xtianzlx gravatar image xtianzlx
21

Hello,

I currently trying to click gmarker on a gmaps, i've done it in javascript, but i need it now in java code .
i tried :

gmap.addEventListener(Events.ON_CLICK, this);

public void onEvent(Event e) throws Exception {
	if(e.getTarget() == gmap) {
			if(e.getTarget() == gmarker) {
				gmarker.setOpen(true);
		}
	}
}

but it doesnt work .
any suggestions ?

Thanks .

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2012-03-26 19:54:48 +0800

mhj gravatar image mhj flag of Brazil
806 1 7

hi xtianzlx:
i don't know if click event works on java side, but maybe you can try send event to java from js event...

link publish delete flag offensive edit

answered 2012-03-27 06:37:01 +0800

xtianzlx gravatar image xtianzlx
21

and how can i do that ?

link publish delete flag offensive edit

answered 2012-03-30 06:51:37 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

Hi,

You can open it in the onMapClick event of Gmaps:

	if (event.getReference() instanceof org.zkoss.gmaps.Gmarker) {
		event.getReference().setOpen(true);
	}

Regards,
Ben

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: 2012-03-26 08:07:40 +0800

Seen: 260 times

Last updated: Mar 30 '12

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