2010.12.10(4)——— android MapView 处理双击事件
在地图上每次都点击放大按钮 再放大 不太好 希望 双击来放大地图
在网上找了一些 大多都是重写onTouchEvent方法
但是 按照网上方法 试了都不行
后来发现 重写dispatchTouchEvent 方法 就好了
/
/处理双击事件
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
count++;
if(count==1){
firstClick = System.currentTimeMillis();
}else if(count==2){
secondClick = System.currentTimeMillis();
if (secondClick - firstClick < 500) {
mapView.getController().zoomInFixing((int) ev.getX(),
(int) ev.getY());
}
count = 0;
firstClick = 0;
secondClick = 0;
}
}
return super.dispatchTouchEvent(ev);
}
分享到:
相关推荐
IOS应用源码——Rotatable MapView for iOS.rar
Android绘图机制与处理技巧(三)——Android图像处理之图形特效处理
■Chapter 4: Using XML-Based Layouts...................................................................................................... 23 ■Chapter 5: Employing Basic Widgets ........................
Android中MapView的使用方法.pdf 学习资料 复习资料 教学资源
4 Exploring the Android SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 What Is in the Android SDK? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
■Chapter 4: Using XML-Based Layouts.................. 23 ■Chapter 5: Employing Basic Widgets ................... 29 ■Chapter 6: Working with Containers.................... 39 ■Chapter 7: Using ...
■CHAPTER 10 Employing Fancy Widgets and Containers ...... 93 ■CHAPTER 11 Applying Menus ...........113 ■CHAPTER 12 Fonts .............. . 125 ■CHAPTER 13 Embedding the WebKit Browser ........ 129 ...
Android MapView 应用,基于Android开发,应用Android SDK 1.5
android 开发中的基础知识 对mapview 的掌握
mapController = mapView.getController(); mapController.setZoom(15); updateView(); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; ...
3.7 简易的按钮事件——Button事件处理 3.8 手机页面的转换——setContentView的应用 3.9 调用另一个Activity——Intent对象的使用 3.10 不同Activity之间的数据传递——Bundle对象的实现 3.11 返回数据到前一个...
8.3.1 嵌入MapView........... 142 8.3.2 准备就绪.................... 145 8.3.3 模拟说明.................... 146 8.4 快速阅读指南.... 147 第9章 SQL实战...... 149 9.1 SQLite简介........... 149...
<com.google.android.maps.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey=...
android MapView地图测试,现在共享下。
3.7 简易的按钮事件——Button事件处理 3.8 手机页面的转换——setContentView的应用 3.9 调用另一个Activity——Intent对象的使用 3.10 不同Activity之间的数据传递——Bundle对象的实现 3.11 返回数据到前一个...
Android平台室内地图控件MapView.zip,Android平台上的地图视图。
ArcGIS Runtime SDK for Android之mapView方法.doc
ArcGIS10的移动GIS开发文档,中文版本,供学习参考。 目录 1 前言............................................................................................................................................
3.7 简易的按钮事件——Button事件处理 3.8 手机页面的转换——setContentView的应用 3.9 调用另一个Activity——Intent对象的使用 3.10 不同Activity之间的数据传递——Bundle对象的实现 3.11 返回数据到前一个...