publiclab / Leaflet.DistortableImage

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

UI for handling multiple images #244

Open sashadev-sky opened 5 years ago

sashadev-sky commented 5 years ago

Branching out some comments from #140 that have to do specifically with UI planning for multiple images to focus on it separately from the work on individual tools and toolbars that attach to a single image, which is a bit of a different case.

These updates may ultimately only apply to the MK repo, but we have been doing a lot of upstream planning and discussion from LDI so it makes sense to continue here.

The end goal is to have multiple image collection actions that are then managed by this UI. Original issue: https://github.com/publiclab/Leaflet.DistortableImage/issues/29

- Eventually we should consider a menu for the manipulation of image collections, for example initiating an export. This relates to publiclab/mapknitter#326, the new MapKnitter Exporter UI, but could also be used for simple things like dragging a group of images together. - and to perform actions using their collected image URLs or other properties.

Some relevant discussion topics

sashadev-sky commented 5 years ago

https://github.com/publiclab/Leaflet.DistortableImage/issues/140#issuecomment-467079304

sashadev-sky commented 5 years ago

https://github.com/publiclab/Leaflet.DistortableImage/issues/140#issuecomment-477444112

saw this on a page on the Mapbox site and thought it was nice for future UI inspiration: 55130302-be80dc80-50f0-11e9-9ced-9710ed3aa00d

sashadev-sky commented 5 years ago

@jywarren How does this look? Please feel free to delete anything copied over here in the PR description that you think is extraneous - I think I copied over a bit too much. And make any other edits / suggestions !

@rexagod

sashadev-sky commented 5 years ago

https://github.com/publiclab/Leaflet.DistortableImage/issues/140#issuecomment-465115860

I already pitched this idea to @jywarren, it implements a mixture of what he has mentioned above, but @rexagod let me know what your thoughts are on this too!. I'm excited to work on this with you!!

@jywarren I have really cleared up the implementation details at this point for the modal menu so maybe we can weigh pros and cons?

I used the Google Maps JavaScript API and the Material UI Kit library as inspiration for this implementation plan:

  1. we can provide a bare minimum toolbar as the initial default (with option to suppress as implemented by rexagod)

  2. The toolbar could be a collapsible module that comes fully functional (as a class that handles its own state for switching tab panes, etc) and styled out of the box. We can define some very basic styling options on it but the main implementation will be to provide "feature types" options that the user can initialize it with or add on later. The feature types would be sensible collections of stand-alone modules such as "exports", "uploads" "image adjustments", "image manipulation", etc. also functional out of the box). Each collection could get its own content tab.

  3. Once that works, we can create even smaller collections of "element types" that the user can select out of the features if they don't want all of them. I think that most design elements travel in some sort of pair (ie. Hue, Saturation & Lightness, Rotate & Scale, Sharpen & Blur)

@jywarren Also I am seeing now my idea is similar to yours but backwards. I would not mind starting bottom-up instead and isolating all of the modules first.

Anyway I definitely want to turn my attention to the export system now since it seems more priority so I am happy to just leave this here as an idea for now and come back to it

jywarren commented 5 years ago

I'll need to dive into this today/tomorrow to get caught up, but on the functional end of exporting, we now have an export URL that works, and accepts a JSON file/string of the images to be warped:

(note NOT https for now:) http://export.mapknitter.org/export?url=https://mapknitter.org/maps/ceres--2/warpables.json&scale=30

You can also run it as a POST or GET with a parameter called collection containing the JSON string.

This outputs a status.json URL -- all documented here! https://github.com/publiclab/Leaflet.DistortableImage/issues/203

jywarren commented 5 years ago

And here: https://github.com/publiclab/mapknitter-exporter-sinatra