I have created two classes to handle touch event on Google Maps.
public class TouchableWrapper extends FrameLayoutand
public class TouchableSupportMapFragment extends SupportMapFragment
TouchableWrapper
class is responsible about touch events, and TouchableSupportMapFragment
class is our new MapFragment
which is extends from SupportMapFragment and it has TouchableWrapper
.
How to use them?
- Add
TouchableWrapper
andTouchableSupportMapFragment
to your project. You can find them in the sample project. - Replace class property of your
SupportMapFragment
withTouchableSupportMapFragment
in your layout.
- Implements
TouchableWrapper.TouchActionDown
andTouchableWrapper.TouchActionDown
to your activity.
import com.muratonnet.map.TouchableWrapper.TouchActionDown; import com.muratonnet.map.TouchableWrapper.TouchActionUp; public class MainActivity extends FragmentActivity implements TouchActionDown, TouchActionUp { @Override public void onTouchDown(MotionEvent event) { } @Override public void onTouchUp(MotionEvent event) { } }
You can find source code and sample usage on
Don't forget to set your "API_KEY" in manifest file to run sample project.
2 comments:
how do i add markers on map V2
I'm unable to find the source Code..!! Can U please help me..
Post a Comment