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

[Question]: Fire map click programmatically to open popup #4697

Open
1 task done
cfsgarcia opened this issue Aug 21, 2024 · 0 comments
Open
1 task done

[Question]: Fire map click programmatically to open popup #4697

cfsgarcia opened this issue Aug 21, 2024 · 0 comments
Labels
javascript Pull requests that update Javascript code question

Comments

@cfsgarcia
Copy link
Contributor

What is the question? (in English)

The following snippet to fire a click event works at launch in Lizmap.

var lastPx = lizMap.map.getPixelFromLonLat({lat: y, lon: x});
event.xy = {x: lastPx.x, y: lastPx.y};
var res = lizMap.map.events.triggerEvent("click", event);

As soon as the map is panned, it stops working. res returns False.

I am wondering how we can open feature popups programmatically from xy coordinates.

Versions, safeguards, check summary etc

Lizmap Web Client 3.7.10
qGIS Server 3.34.6

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Ubuntu 22.04.2 LTS

Browsers

Chrome

Browsers version

127.0.6533.120 (Official Build) (64-bit)

Relevant log output

No response

@Gustry Gustry added the javascript Pull requests that update Javascript code label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code question
Projects
None yet
Development

No branches or pull requests

2 participants