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

Allow featureGroup initialization with no overlay corners #381

Merged
merged 19 commits into from
Aug 15, 2019

Conversation

sashadev-sky
Copy link
Member

@sashadev-sky sashadev-sky commented Aug 14, 2019

A step to fix publiclab/mapknitter#919 (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with grunt
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updates
  • @mention the original creator of the issue in a comment below for help or for a review

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@sashadev-sky
Copy link
Member Author

@rexagod @jywarren this PR is very small in code changes but makes a bigger difference to how the library can be used.

corners has never been a required option for L.distortableImageOverlay, but they were for DistortableCollection because I added a call to img.editing.enable from there. I moved this call inside the overlay class instead, since we already have an event listener there for image load.

I updated the README pretty thoroughly to basically make the point that for single image interface you don't really need them but for multi you want to include them or the images will render on top of eachother. The index.html and select.html demos now reflect this too!

I think it actually makes the plugin a lot easier to use, because people can add images to the map quickly, and use our API to retrieve the corners for a position they like and then add in the corners option. Otherwise they have to calculate it themselves and risk distorting their image.

@sashadev-sky
Copy link
Member Author

in MK, hopefully this will allow us to stop adding images to the map instead of the feature group.

It also calls img.editing.enable by default once they're added to the map, so I bumped to 0.8.0. but this is already what we were doing for the feature group anyway.

@sashadev-sky
Copy link
Member Author

ok I just found that @rexagod uses custom logic for img.editing.enable #312 and I have a feeling others might want to as well, so I am going to create an enabled option that can be set to false so that image editing isn't automatically enabled on load

@jywarren
Copy link
Member

jywarren commented Aug 14, 2019 via email

@jywarren
Copy link
Member

Ah, does this fix publiclab/mapknitter#919 or what else would be required? I'm very eager to get that resolved, so any tips appreciated here! Thank you!

@sashadev-sky
Copy link
Member Author

@jywarren Might fix it or might just be one step in fixing it. It's basically ready for review, all I am doing is adding an enabled option which will run based on a conditional. I will finish this ASAP. The main part to really review is to just read through the README.

@jywarren
Copy link
Member

jywarren commented Aug 14, 2019 via email

@jywarren
Copy link
Member

jywarren commented Aug 14, 2019 via email

@sashadev-sky
Copy link
Member Author

I had to do a lot of restructuring and make a #335 for this option to work properly with both groups. almost done tho!

@sashadev-sky
Copy link
Member Author

@jywarren ok this turned into a complicated one but it is done now. @rexagod @ViditChitkara I think enable, disable, editable API could come up for you guys so check it out! Let me know your thoughts.

Easiest probably to just look at README and try the code out if u'd like

@ViditChitkara
Copy link
Member

That's awesome!! Will check this out.
Thanks

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple tiny queries about the docs. This is an incredible PR! The README is so great. cc @IshaGupta18 @rexagod just generally as it's a great PR, and also cc @ananyaarun @sagarpreet-chadha on the UI testing in here, it could be useful?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jywarren
Copy link
Member

And shall we bump to 0.7.1 with this? Any breaking changes? I think not...

@sashadev-sky
Copy link
Member Author

And shall we bump to 0.7.1 with this? Any breaking changes? I think not...

I made it 0.8.0 because a) seemed like a big API update and I wanted people to notice the update corners stuff. b) Could be breaking for any implementations that make the image editing interface turn on by some custom logic rather than load. But doesn't matter anyway and the odds are slim.

Updated to 0.7.1

@sashadev-sky sashadev-sky merged commit 9847963 into publiclab:main Aug 15, 2019
@rexagod rexagod mentioned this pull request Aug 15, 2019
6 tasks
sashadev-sky added a commit that referenced this pull request Sep 15, 2019
* test how readme formatting is rendered

* update formatting

* make documented setters return this

* bump to 0.8.0

* update

* update demo

* fix grammer

* update to use DistortableCollection.Edit

* complete API

* make API make sense

* fix mobile

* update readme

* update cmment

* revert demo change

* revert both demo changes

* refactor

* add new line to end of file

* make final updates

* fix typo
themacboy pushed a commit to themacboy/Leaflet.DistortableImage that referenced this pull request Sep 19, 2019
)

* test how readme formatting is rendered

* update formatting

* make documented setters return this

* bump to 0.8.0

* update

* update demo

* fix grammer

* update to use DistortableCollection.Edit

* complete API

* make API make sense

* fix mobile

* update readme

* update cmment

* revert demo change

* revert both demo changes

* refactor

* add new line to end of file

* make final updates

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

Successfully merging this pull request may close these issues.

multiple image cloud export only returning one image
4 participants