Newer
Older
dxcgt / app / src / main / java / com / smartdot / cgt / view / MyLocationMapView.java
wangxitong on 6 Apr 2021 896 bytes first commit
package com.smartdot.cgt.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.PopupOverlay;

public class MyLocationMapView extends MapView
{
	public static PopupOverlay pop = null;// 弹出泡泡图层,点击图标使用

	public MyLocationMapView(Context context)
	{
		super(context);
		// TODO Auto-generated constructor stub
	}

	public MyLocationMapView(Context context, AttributeSet attrs)
	{
		super(context, attrs);
	}

	public MyLocationMapView(Context context, AttributeSet attrs, int defStyle)
	{
		super(context, attrs, defStyle);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event)
	{
		if (!super.onTouchEvent(event))
		{
			// 消隐泡泡
			if (pop != null && event.getAction() == MotionEvent.ACTION_UP)
				pop.hidePop();
		}
		return true;
	}
}