I want to geocode address as soon as map center has been changed.
How can I handle map moveend with new Google Maps for Android V2? (I'm talking about the case then user drags map by finger)
I want to geocode address as soon as map center has been changed.
How can I handle map moveend with new Google Maps for Android V2? (I'm talking about the case then user drags map by finger)
I have to animate my marker to center as long as the user drag the map. I have implemented it using Stas Shakirov answer
MapDragListenerFragment.class
where fragment_map_drag_listener.xml
where MapDragListenerActivity
activity_map_drag_listener.xml
I think the event onclick in the map is: map.setOnMapClick... But event drag is: map.onCameraChangeListener because I call a log.e in both of that functions and it shown like onClick view and onDrag view . So just using them for you.
Enhanced solution with an Handler inner Class in Xamarin Android, based on Tobus answer:
With the following inner Class:
Here is a possible workaround for determining drag start and drag end events:
You have to extend SupportMapFragment or MapFragment. In onCreateView you have to wrap your MapView in a customized FrameLayout (in example below it is the class "TouchableWrapper"), in which you intercepts touch events and recognizes whether the map is tapped or not. If your "onCameraChange" gets called, just check whether the map view is pressed or not (in example below this is the variable "mMapIsTouched").
Example code:
UPDATE 1:
Customized FrameLayout:
In your customized MapFragment:
In your camera change callback method: