private < T > void setupMarkerFixedNoRepeatHack ( GoogleV3Marker < T > genericMarker ) { final Marker marker1 = genericMarker . getMarker ( ) ; final LatLng [ ] initialPosition = new LatLng [ 1 ] ; marker1 . addDragStartHandler ( new DragStartMapHandler ( ) { @ Override public void onEvent ( DragStartMapEvent dragStartMapEvent ) { initialPosition [ 0 ] = marker1 . getPosition ( ) ; } } ) ; marker1 . addDragEndHandler ( new DragEndMapHandler ( ) { @ Override public void onEvent ( DragEndMapEvent dragEndMapEvent ) { marker1 . setPosition ( initialPosition [ 0 ] ) ; } } ) ; }
Prevent marker from repeating horizontally by setting marker drag and adjusting drag behaviour to reset