コード例 #1
0
 public boolean onTap(GeoPoint pt, MapView mapView) {
   if (pop != null) {
     pop.hidePop();
   }
   super.onTap(pt, mapView);
   return false;
 }
コード例 #2
0
ファイル: BaiduMapActivity.java プロジェクト: wmhqnyh/zaina
  private void showMap(double latitude, double longtitude, String address) {
    sendButton.setVisibility(View.GONE);

    GeoPoint point1 = new GeoPoint((int) (latitude * 1e6), (int) (longtitude * 1e6));
    point1 = CoordinateConvert.fromGcjToBaidu(point1);
    mMapController.setCenter(point1);
    Drawable marker = this.getResources().getDrawable(R.drawable.icon_marka);
    // 为maker定义位置和边界
    marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight());
    mAddrOverlay = new ItemizedOverlay<OverlayItem>(marker, mMapView);
    GeoPoint point = new GeoPoint((int) (latitude * 1e6), (int) (longtitude * 1e6));
    point = CoordinateConvert.fromGcjToBaidu(point);
    OverlayItem addrItem = new OverlayItem(point, "", address);
    mAddrOverlay.addItem(addrItem);
    mMapView.getOverlays().add(mAddrOverlay);
    mMapView.refresh();
  }