/** * 初始化地图 */ private void initMap() { //设置MapView mMapView = (MapView)findViewById(R.id.bmapsView); mMapView.setBuiltInZoomControls(true); //设置启用内置的缩放控件 mMapView.showScaleControl(true); //显示比例尺 //地图控制器 mMapController = mMapView.getController(); //我的位置 myLocationOverlay = new MyLocationOverlay(mMapView); //设置弹出窗 mPopWindow = new PopupOverlay(mMapView, new MyPopupClickListener()); }
public void initView() { mBtnDetail = (Button) findViewById(R.id.btn_detail); mMapView = (MapView) findViewById(R.id.mv_mapview); mMapView.setOnTouchListener(getOnTouchListener()); mPopupTextView = new TextView(this); mPopupTextView.setTextColor(Color.RED); mPopupTextView.setPadding(50, 50, 50, 50); mPopupTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.f); mPopupTextView.setGravity(Gravity.CENTER); mPopupOverlay = new PopupOverlay(mMapView, new PopupClickListenerImpl()); }
private void initPopup() { view = ((LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate( R.layout.popup_layout, null); popup = new PopupOverlay(mMapView, new PopupClickListener() { // ������ public void onClickedPopup(int index) { } }); }
public void createPaopao() { viewCache = getLayoutInflater() .inflate(R.layout.custom_text_view, null); popupText = (TextView) viewCache.findViewById(R.id.textcache); // ���ݵ����Ӧ�ص� PopupClickListener popListener = new PopupClickListener() { @Override public void onClickedPopup(int index) { Log.v("click", "clickapoapo"); } }; pop = new PopupOverlay(mMapView, popListener); MyLocationMapView.pop = pop; }