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

Stacking tools - need guidance/docs on how to enable them #649

Closed
jywarren opened this issue May 12, 2020 · 1 comment
Closed

Stacking tools - need guidance/docs on how to enable them #649

jywarren opened this issue May 12, 2020 · 1 comment
Labels

Comments

@jywarren
Copy link
Member

jywarren commented May 12, 2020

I'm seeing that in both MapKnitter.org and the demo here (https://publiclab.github.io/Leaflet.DistortableImage/examples/), there is no longer a "raise to top" or "send to bottom" tool, and some folks have been asking about it.

I see in the docs that it's an "add-on" tool: L.StackAction with q, a hotkeys. But how do we turn on "add-on" tools?

Looks like we should be able to use L.DistortableImage.Edit's addTool() method... looking...

And maybe include it on this line:
https://github.com/publiclab/mapknitter/blob/77ccb1535c85c227410e2594e596eef26395043b/app/assets/javascripts/mapknitter/Map.js#L95

following the format:

img = L.distortableImageOverlay('example.jpg', {
  actions: [L.OpacityAction, L.DeleteAction, L.RevertAction],
}).addTo(map);

Aha! Yes, this works!

map._layers[54].editing.addTool(L.StackAction)

OK!

@jywarren
Copy link
Member Author

Done here! Let's check on stable.mapknitter.org too!

publiclab/mapknitter@c071de2

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

No branches or pull requests

1 participant