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

Activate getFeatureInfo on button cklick #55

Open
diskmanti opened this issue Apr 10, 2018 · 1 comment
Open

Activate getFeatureInfo on button cklick #55

diskmanti opened this issue Apr 10, 2018 · 1 comment

Comments

@diskmanti
Copy link

Hello,

I am trying to use your plugin and activate the getFeatureInfo request on a button click, a separate button using easyButton. I red the docs but there was no mention on how to activate the request on a button press, only on map click event.

Thanks in advance

@apdevelop
Copy link

The standard WMS GetFeatureInfo request requires an (x,y) pixel value from a previously returned image from GetMap request.
For similar task I use workaround with positioning map to object with known coordinates and calling identify function with necessary arguments:

var point = L.latLng(...);
map.setView(point, map.getZoom(), { animate: false });
wmsOverlay.identify({                    
    containerPoint: map.latLngToContainerPoint(point),
    latlng: point
});

It's probably possible to do this without altering map state, but it will require some work with projecting/unprojecting coordinates.

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

2 participants