osm_flutter
osm_flutter copied to clipboard
[discussion] select position in map
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();
any one of the developer that use this plugin can share his opinion/suggetion about this changes that i want to do
Can we have option for both ?
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
Personally I wouldn't want to freeze the screen. There is already an option to add a marker right ?
only selectPosition
but i think should be add new function to add marker in specific position
i will see how to improve that behaviour
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?
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
nice, looks great for me
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
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)
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
oh! Now it's clear. I think that approach would work great.
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
the new version 0.7.9
was shipped
feel free to test it and if there any problem,i'm here to solve it
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.
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
i will update the example with the new way when i add addMarker
method it will be avalaible soon
the bug was fix checktout 0.7.9+1