Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect click and move of point? #737

Closed
q2apro opened this issue Jan 15, 2019 · 6 comments
Closed

How to detect click and move of point? #737

q2apro opened this issue Jan 15, 2019 · 6 comments

Comments

@q2apro
Copy link

q2apro commented Jan 15, 2019

I want to run a function only after a click or move of a point A has been done by the user.

I could not find this information in the docs.

Maybe mover() is one way to do it? However, if(mover() == "A", /* do stuff */) does not work.

@strobelm
Copy link
Member

mover is the operator you are looking for. It yields a handle to the GeoObject and its name is just a property. Comparing mover().name should work.

@q2apro
Copy link
Author

q2apro commented Jan 15, 2019

Thanks a lot, it works:

if(
	mover().name == "A", 
	animpoint = false;
);

@q2apro
Copy link
Author

q2apro commented Jan 15, 2019

Successive question: Is there any way to prevent the Not moving anything at the moment output in the console while using mover()?

@strobelm
Copy link
Member

I think there is no switch, currently. You could detach the console completely (see https://cindyjs.org/ref/createCindy.html#csconsole).

@q2apro
Copy link
Author

q2apro commented Jan 15, 2019

If it is null, error output will be suppressed except for output to the web developer console.

I tried csconsole: null, but still the console shows Not moving anything at the moment.

@montaga
Copy link
Member

montaga commented Jan 15, 2019

The console for csconsole: null is the web developer console.

Anyway, with the next release of CindyJS (or https://cindyjs.org/dist/snapshot/Cindy.js), Not moving anything at the moment will not be shown anymore: eb21b52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants