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

Normalize keybindings #229

Merged
merged 28 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a207da0
dist file
sashadev-sky Mar 24, 2019
766ded1
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Mar 31, 2019
517c86a
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 4, 2019
1a960f2
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 6, 2019
729242c
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 11, 2019
f4ca34d
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 16, 2019
62a5448
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 20, 2019
301e5dd
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 20, 2019
cc8b8d1
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky Apr 25, 2019
85af450
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky May 5, 2019
dafef00
Merge branch 'main' of https://github.com/publiclab/Leaflet.Distortab…
sashadev-sky May 7, 2019
00ea752
Delete 3 hotkeys
sashadev-sky Apr 21, 2019
8967851
Both select and index demos use rotateScaleHandles now
sashadev-sky Apr 21, 2019
5f48cd2
Keep regular rotate
sashadev-sky Apr 21, 2019
93bdcd8
Update some naming conventions
sashadev-sky Apr 21, 2019
669db3e
Make sure lock mode is secure
sashadev-sky Apr 21, 2019
1b6c0b6
Initialize image as already selected
sashadev-sky Apr 21, 2019
8440586
for multiple image select, hotkeys only toggle single selected image
sashadev-sky Apr 22, 2019
5733805
Make sure that removeOverlay first removes layer from feature group
sashadev-sky Apr 22, 2019
c4d4d0c
revert support for multi image delete
sashadev-sky Apr 22, 2019
8fc720a
Update keybindings to use key property
sashadev-sky Apr 30, 2019
d9ef682
Add option to initialize image as select
sashadev-sky May 1, 2019
f15fce0
Add testing for lock handles
sashadev-sky May 5, 2019
4b9b84b
Complete testing for lock mode
sashadev-sky May 5, 2019
a6df69c
Fix rebase
sashadev-sky May 5, 2019
bbb18a1
Improve documentation
sashadev-sky May 5, 2019
b447319
fix typo
sashadev-sky May 5, 2019
2041b2b
rebase
sashadev-sky May 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ module.exports = function(grunt) {
concat: {
dist: {
src: [
'src/util/*.js',
'src/DistortableImageOverlay.js',
'src/edit/getEXIFdata.js',
'src/edit/EditHandle.js',
'src/edit/LockHandle.js',
'src/edit/DistortHandle.js',
'src/edit/RotateAndScaleHandle.js',
'src/edit/RotateHandle.js',
'src/edit/ScaleHandle.js',
'src/DistortableCollection.js',
'src/edit/BoxSelectHandle.js',
'src/edit/tools/DistortableImage.Keymapper.js',
'src/edit/DistortableImage.EditToolbar.js',
'src/edit/DistortableImage.Edit.js'
'src/util/*.js',
'src/DistortableImageOverlay.js',
'src/DistortableCollection.js',
'src/edit/getEXIFdata.js',
'src/edit/EditHandle.js',
'src/edit/LockHandle.js',
'src/edit/DistortHandle.js',
'src/edit/RotateScaleHandle.js',
'src/edit/RotateHandle.js',
'src/edit/ScaleHandle.js',
'src/edit/DistortableImage.EditToolbar.js',
'src/edit/DistortableImage.Edit.js',
'src/edit/tools/DistortableImage.Keymapper.js',
'src/edit/BoxSelectHandle.js'
],
dest: 'dist/leaflet.distortableimage.js',
}
Expand Down
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ L.tileLayer('https://{s}.tiles.mapbox.com/v3/anishshah101.ipm9j6em/{z}/{x}/{y}.p
// create an image
img = L.distortableImageOverlay(
'example.png', {
// 'corners' is the only required option for this class
corners: [
L.latLng(51.52,-0.10),
L.latLng(51.52,-0.14),
Expand All @@ -70,6 +71,27 @@ img = L.distortableImageOverlay(
L.DomEvent.on(img._image, 'load', img.editing.enable, img.editing);
```

Options available to pass during `L.DistortableImageOverlay` initialization:
- corners

- [selected](#selection)

- mode

- [fullResolutionSrc](#Full-resolution%20download)

- [keymapper](#keymapper)

- [suppressToolbar](#suppressToolbar)


## Selected
(*optional*, default: false, value: *boolean*)

By default, your image will initially appear on the screen as "unselected", meaning its toolbar and editing handles will not be visible. Interacting with the image, such as by clicking it, will make these components visible.

Some developers prefer that an image initially appears as "selected" instead of "unselected". In this case, we provide an option to pass `selected: true`.

## Keymapper
(_optional_, default: true, value: _boolean_)

Expand All @@ -86,8 +108,6 @@ We've added a GPU-accelerated means to generate a full resolution version of the

When instantiating a Distortable Image, pass in a `fullResolutionSrc` option set to the url of the higher resolution image. This image will be used in full-res exporting.



```js

// create basic map setup from above
Expand All @@ -110,6 +130,15 @@ L.DomEvent.on(img._image, 'load', img.editing.enable, img.editing);

```

## suppressToolbar
(*optional*, default: false, value: *boolean*)

To initialize an image without its toolbar, pass it `suppressToolbar: true`.

Typically, editing actions are triggered through our toolbar interface or our predefined keybindings. If disabling the toolbar, the developer will need to implement their own toolbar UI or just use the keybindings.

This option will override other options related to the toolbar, such as [`selected: true`](#Selected)

## Multiple Images

To test the multi-image interface, open `select.html`. Currently it supports multiple image selection and translations; image distortions still use the single-image interface.
Expand Down
Loading