-
Notifications
You must be signed in to change notification settings - Fork 591
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
Option to be able to drag the feature in direct_select mode #452
Conversation
@kirach This is great. Thanks. Also, nice use of custom styles. 😄 It looks like the main goal here is to add dragging a feature to
I think the next step here is to refactor the shared functionality with |
@mcwhittemore I've just finished work on this feature. Review please. I decided that it doesn't worth to create a separate mode for dragging feature because it's basically the Let me know what you think. If it's ok I'll update the README to add the option description. |
@kirach I'll give this a good look over tomorrow |
ctx.map.dragPan.disable(); | ||
this.render(e.featureTarget.properties.id); | ||
|
||
// Set up the state for drag moving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call startDragging()
here.
@kirach I liked this a bit more when it was its own mode and not a flag in a mode. @davidtheclark and I have been talking about dropping the options argument in It is also stepping into a convo we've been having about changing how mode handlers work. I'm pretty comfortable with adding extra modes as I want to create a way for users to create custom modes and having non-default modes as part of the tool before that happens mean we would have a few custom modes automatically when we roll out that feature. That said... this is really close to |
@mcwhittemore The main issue with separate mode was that it was almost 90% of copy-paste from If you want - I can move back to separate mode, but it still will be a lot of copy-paste from |
Interesting! Recently, I had almost the same task. To avoid problem with modes I implemented a plugin similar to Leaflet AreaSelect but with ability to change hole. |
+1 for seeing this PR completed. I too use Draw to aid geo-bounded searches, and the draggability issue in the GL version, compared to the old (e.g on geojson.io) is definitely something which would greatly improve usability. |
This has been implemented as the default behaviour via #536. It will be out in the 0.15.0 release. |
Hi!
We use this library a lot for our project: https://compstak.com
And recently we released a new version with Google maps replaced by Mapbox GL maps. Everything works like a charm, thanks for your work. But there is one issue and we have a couple users that already complained about it - so it's pretty important for us.
Little story: we use maps for search. And users are able to use different map search tools. One of these tools is so called "polygon search": user just puts a polygon shape to the map and should be able to resize/drag it to perform search. Like this:
But the problem is that your library has separate modes for dragging features (simple_select) and for resizing (direct_select). So it's not possible for us to allow users to drag and to resize polygon at the same time. (And it used to work when we had goole maps - so that's why users complain about it).
Here is my attempt to solve this issue by creating new mode. I called if
mixed
mode (but you can suggest better name). Basically it's just a mix ofsimple_select
anddirect_select
modes.The work is still in progress, and I have to write some tests at least. But just let me know what do you think about idea of this mode. And what else I should implement here.
Thanks!