ibrierley / flutter_map_line_editor

A basic line/poly editor that works with flutter_map and dragmarkers.
MIT License
44 stars 25 forks source link

Problem with editing line segment #5

Closed zozeei closed 3 years ago

zozeei commented 3 years ago

Hi,

I am having trouble editing the last line segment of the polygon (line connecting point 1 and 3) for it cannot be extended or bent. Do you have a suggestion for fixing this problem? polygon

ibrierley commented 3 years ago

It's not very clear from the image....in the issue you raised a few days ago, you were able to add points, so I'm wondering what you have that's different now ?

zozeei commented 3 years ago

Sorry, the image I sent was not very clear. I am sending a new one. The issue is that I cannot drag (edit) the line segment of point 1 and 3. Screenshot_1599701875

ibrierley commented 3 years ago

Ah yes, I think that makes sense logically, as there is no actual end point back to the start, it's assumed there is sort of an extra one inferred back to the beginning which it can't see.

Not quite sure the best way to handle that, as I'd prefer it not to know any underlying line or shape and just handle a set of points, but maybe there could be an option to infer an extra line back to the beginning. I'll have a ponder, but probably won't get chance to have a play for a day or so. In the interim, I guess you can add an extra point by dragging between 2 and 3, but that's a bit clunky to have to move the last bit each time, so does feel like it could do with something there to help.

ibrierley commented 3 years ago

Ok, I've added an option addClosePathMarker : true/false. Set to true if you want the extra marker on a closed final section like a closed polygon. Set to false if a line. See if that helps.

zozeei commented 3 years ago

Thank you very much for your help! It's working fine now. I've changed from 0 to 2 in this line of code so that it can handle polygon type 1599789706108

ibrierley commented 3 years ago

Ok thanks, what happened if the check > 0 was left instead of 2 out of interest (it makes sense for it to be > 2), were there duplicate markers on the first leg or something ?

zozeei commented 3 years ago

Yes, there duplicate markers on the first leg . thanks you

ibrierley commented 3 years ago

Super, thanks for the update. I'll add that change to git.