publiclab / Leaflet.DistortableImage

A Leaflet extension to distort or "rubber sheet" images
https://publiclab.github.io/Leaflet.DistortableImage/examples/
BSD 2-Clause "Simplified" License
265 stars 284 forks source link

Retrieving updated corners once events have occured #1335

Closed DLParkin closed 1 year ago

DLParkin commented 1 year ago

Enjoying playing with this tool but no code to show since it is more of a question.

I was hoping to be able to get the updated corners after an event occurs but can not seem to find any documentation on it and could not find an issue specific to this.

Has anyone been able to get the corners?

I did try layer._corners, layer.getCorners() but no results (layer been layer = L.distortableImageOverlay(foo... )

If it is not possible I will clone the library and add the code I need but it seems like something that should be available?

Seems possible to get from the leaflet map but feels a little messy and was after a clean solution.

Appreciate any thought/guidance.

Regards, David

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! This space is protected by our Code of Conduct - and we're here to help. Please follow the issue template to help us help you 👍🎉😄 If you have screenshots or a gif to share demonstrating the issue, that's really helpful! 📸 You can make a gif too! Do join our Gitter channel for some brainstorming discussions.

DLParkin commented 1 year ago

So it seems if I add it to L.distortableCollection() I gain access to the corners no problem at all so all these options work

  console.log(layer.getCorners());
  console.log(layer._corners);
  console.log(layer.getBounds());