osm_flutter icon indicating copy to clipboard operation
osm_flutter copied to clipboard

[discussion] select position in map

Open liodali opened this issue 3 years ago • 18 comments

selection in plugin we can by this code


var geoPoint = await controller.selectPosition();

the problem with that is we freez the all other feature until user tap on screen so i want to discussion is that fine because i planned to change that behaviour and make plugin accept longPress to add new marker for example


controller.listToLongPress((geoPoint){
 // some code

});
controller.selectPosition();

liodali avatar Jun 15 '21 12:06 liodali

any one of the developer that use this plugin can share his opinion/suggetion about this changes that i want to do

liodali avatar Jun 15 '21 12:06 liodali

Can we have option for both ?

jesussmile avatar Jun 18 '21 16:06 jesussmile

i don't think we can keep them unless that i keep the first behaviour and i add listener for longPress and i add new method to add marker on that position

liodali avatar Jun 18 '21 16:06 liodali

Personally I wouldn't want to freeze the screen. There is already an option to add a marker right ?

jesussmile avatar Jun 18 '21 17:06 jesussmile

only selectPosition but i think should be add new function to add marker in specific position i will see how to improve that behaviour

liodali avatar Jun 18 '21 17:06 liodali

I think this feature would be great. I haven't used it much but I think as of now for adding marker we have to call selectPosition every time. right? if this feature is introduced then we don't have to call the method before tapping on the screen, we just have to listen to long tap. Am I right?

aadarshadhakalg avatar Jun 23 '21 08:06 aadarshadhakalg

yeah that what i'm try to think about and also i want to add another method that add an default marker or custom to map direclty without need to make selection or selection already happen it depend on the situation but for now I will keep for now that behaviour and i will add longTapListener and after sometime maybe i will deprecrate await selectPosition because the second behaviour make my life easy when i will support the web

liodali avatar Jun 23 '21 08:06 liodali

nice, looks great for me

aadarshadhakalg avatar Jun 23 '21 08:06 aadarshadhakalg

i will start add this feature when i finish draw road in ios part maybe next week i will add it to android and i start look at it in ios

liodali avatar Jun 23 '21 08:06 liodali

Didn't realize selectPosition had to be called every time, I don't mind the current way of scrolling and pick up location, With long press, I think the location will be a little offset because of the size of the thumb, The user will have to zoom in a lot, On the web with mouse pointers it should be fine, May I know why have you not chosen to implement single tap? (Just my thought)

jesussmile avatar Jun 23 '21 11:06 jesussmile

in selectPosition is implemented with singleTap but with listener that can be tricky becuase user can just want to move and accidentally that can produce singleTap si here will will make lot calls that not need it even if you don't listen to it and in native side will stay send data so i prefer longPress but i will keep selectPosition with same behaviour and i will add listener for longpress and add method to addMarker directly

liodali avatar Jun 23 '21 12:06 liodali

oh! Now it's clear. I think that approach would work great.

jesussmile avatar Jun 23 '21 12:06 jesussmile

see this comment https://github.com/liodali/osm_flutter/issues/104#issuecomment-872371820 singleTap and LongPress will be shipped in the next version also i removed the longPress on marker (that lead to conflit) for now until i found a way how i will distinct between map click and marker click at least for android side because ios is another behaviour

liodali avatar Jul 01 '21 16:07 liodali

the new version 0.7.9 was shipped feel free to test it and if there any problem,i'm here to solve it

liodali avatar Jul 01 '21 16:07 liodali

Hey! Thanks for the update, Have you changed the default behavior to draw roads as per the previous version? Can you please explain exactly what is new here? Would be nice if you could update the example file as well.

jesussmile avatar Jul 02 '21 05:07 jesussmile

Hi, no i didn't change any things but I forget to disable listener when await selectPosition called i will make quick fix for that,it's my fault

liodali avatar Jul 02 '21 06:07 liodali

i will update the example with the new way when i add addMarker method it will be avalaible soon

liodali avatar Jul 02 '21 06:07 liodali

the bug was fix checktout 0.7.9+1

liodali avatar Jul 02 '21 09:07 liodali