當前位置: 首頁>>代碼示例>>Java>>正文


Java MapView類代碼示例

本文整理匯總了Java中com.baidu.mapapi.map.MapView的典型用法代碼示例。如果您正苦於以下問題:Java MapView類的具體用法?Java MapView怎麽用?Java MapView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MapView類屬於com.baidu.mapapi.map包,在下文中一共展示了MapView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
private void initView() {
    mapView = (MapView) findViewById(R.id.see_location_mapview);
    toolBarView = (ToolBarView) findViewById(R.id.see_location_toolbar);

    toolBarView.setBackButtonImage(R.mipmap.icon_back);
    toolBarView.setBackButtonVisible(true);
    toolBarView.setBackButtonOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolBarView.setTitleText("查看接單人位置");

    baiduMap = mapView.getMap();

    MapStatusUpdate update = MapStatusUpdateFactory.zoomTo(19f);
    baiduMap.setMapStatus(update);

    handler = new MyHandler(this);


}
 
開發者ID:838030195,項目名稱:DaiGo,代碼行數:24,代碼來源:SeeLocationActivity.java

示例2: initView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
private void initView() {
    client = new LocationClient(getApplicationContext());
    client.registerLocationListener(new RunningActivity.MyLocationListener());
    rootLayout = (LinearLayout) findViewById(R.id.running_root_layout);
    mapView = (MapView) findViewById(R.id.bmapView);
    startButton = (CircularProgressButton) findViewById(R.id.cpb_button);
    latLngText = (TextView) findViewById(R.id.lat_lng_text);
    speedNumber = (TextView) findViewById(R.id.speed_text);
    distanceNumber = (ImageNumberDisplayView) findViewById(R.id.distance_text);
    stepNumber = (ImageNumberDisplayView) findViewById(R.id.running_step);
    energyNumber = (ImageNumberDisplayView) findViewById(R.id.running_energy);
    setToolbar(R.id.running_toolbar, true);

    timer = (Chronometer) findViewById(R.id.timer);
    baiduMap = mapView.getMap();
    startButton.setClickable(false);
    startButton.setIndeterminateProgressMode(true);
}
 
開發者ID:SailFlorve,項目名稱:RunHDU,代碼行數:19,代碼來源:RunningActivity.java

示例3: onCreate

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_location);

        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//獲取傳感器管理服務
//        mCurrentMode = LocationMode.NORMAL;

        // 地圖初始化
        mMapView = (MapView) findViewById(R.id.bmapView);
        mBaiduMap = mMapView.getMap();
        // 開啟定位圖層
        mBaiduMap.setMyLocationEnabled(true);
        // 定位初始化
        mLocClient = new LocationClient(this);
        mLocClient.registerLocationListener(myListener);
        LocationClientOption option = new LocationClientOption();
        option.setOpenGps(true); // 打開gps
        option.setCoorType("bd09ll"); // 設置坐標類型
        option.setScanSpan(1000);
        mLocClient.setLocOption(option);
        mLocClient.start();
    }
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:24,代碼來源:LocationDemo.java

示例4: onCreate

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_routeplan);
        mTvtitle = (TextView) findViewById(R.id.tv_topbar_title);
        mTvtitle.setText("財神穀地址");
        ImageView img = (ImageView) findViewById(R.id.img_topbar_back);
        img.setImageResource(R.mipmap.icon_back);
        img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RoutePlanDemo.this.finish();
            }
        });
//        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);//獲取傳感器管理服務
        // 初始化地圖
        mMapView = (MapView) findViewById(R.id.map);
        mBaidumap = mMapView.getMap();
        MapStatus.Builder builder = new MapStatus.Builder();
        builder.zoom(18.0f);
        builder.target(new LatLng(29.184662, 121.305024));
        mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(builder.build());
        mBaidumap.setMapStatus(mMapStatusUpdate);
        MarkerOptions ooA = new MarkerOptions().position(GEO_NINGBO).icon(bdA)
                .zIndex(9).draggable(true);
        mBaidumap.addOverlay(ooA);
        mBaidumap.setTrafficEnabled(true);
        findViewById(R.id.lin_action_route).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                go2ThirdMap();
            }
        });
    }
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:34,代碼來源:RoutePlanDemo.java

示例5: onCreate

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routeplan);
    CharSequence titleLable = "路線規劃功能";
    setTitle(titleLable);
    // 初始化地圖
    mMapView = (MapView) findViewById(R.id.map);
    mBaidumap = mMapView.getMap();
    mBtnPre = (Button) findViewById(R.id.pre);
    mBtnNext = (Button) findViewById(R.id.next);
    mBtnPre.setVisibility(View.INVISIBLE);
    mBtnNext.setVisibility(View.INVISIBLE);
    // 地圖點擊事件處理
    mBaidumap.setOnMapClickListener(this);
    // 初始化搜索模塊,注冊事件監聽
    mSearch = RoutePlanSearch.newInstance();
    mSearch.setOnGetRoutePlanResultListener(this);
}
 
開發者ID:shenhuanet,項目名稱:AndroidOpen,代碼行數:19,代碼來源:RoutePlanDemo.java

示例6: setMapView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
private void setMapView() {
    BaiduMapOptions options = new BaiduMapOptions();
    options.compassEnabled(false);
    options.overlookingGesturesEnabled(false);
    options.rotateGesturesEnabled(false);
    options.scaleControlEnabled(true);
    options.zoomControlsEnabled(false);
    MapStatus.Builder status = new MapStatus.Builder();
    if (Config.Zoom > Float.NEGATIVE_INFINITY)
        status.zoom(Config.Zoom);
    if (Config.Latitude > Double.NEGATIVE_INFINITY && Config.Longitude > Double.NEGATIVE_INFINITY)
        status.target(new LatLng(Config.Latitude, Config.Longitude));
    options.mapStatus(status.build());
    mMapView = new MapView(this, options);

    mMapView.getMap().setMyLocationEnabled(true);
    mMapView.getMap().setBuildingsEnabled(false);
    mMapView.getMap().setOnMapStatusChangeListener(this);

    MapViewUtils.initViewPositions(mMapView);
    MapViewUtils.addMapView(this, mMapView);
}
 
開發者ID:iWay7,項目名稱:BikeHelper,代碼行數:23,代碼來源:MainActivity.java

示例7: setMapView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
private void setMapView() {
    BaiduMapOptions options = new BaiduMapOptions();
    options.compassEnabled(false);
    options.overlookingGesturesEnabled(false);
    options.rotateGesturesEnabled(false);
    options.scaleControlEnabled(true);
    options.zoomControlsEnabled(false);
    mMapView = new MapView(this, options);

    mMapView.getMap().setBuildingsEnabled(false);
    mMapView.getMap().setMapType(Config.MapType);

    MapViewUtils.initViewPositions(mMapView, false);
    MapViewUtils.addMapView(this, mMapView);
    MapViewUtils.addLineOverlay(mMapView, mRoutePoints, 0);
    MapViewUtils.addDrawableOverlay(mMapView, R.drawable.ic_route_start, mRouteData.getBeginLatlng(), 2);
    MapViewUtils.addDrawableOverlay(mMapView, R.drawable.ic_route_end, mRouteData.getEndLatlng(), 1);
    MapViewUtils.zoomToMaxLevel(mMapView, false);
    MapViewUtils.moveToLatLng(mMapView, mRouteData.getBeginLatlng(), false);
}
 
開發者ID:iWay7,項目名稱:BikeHelper,代碼行數:21,代碼來源:RouteViewActivity.java

示例8: onCreate

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //在使用SDK各組件之前初始化context信息,傳入ApplicationContext
    //注意該方法要再setContentView方法之前實現
    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.activity_location_baidu_map);
    //獲取地圖控件引用
    mMapView = (MapView) findViewById(R.id.bmapView);
    mBaiduMap = mMapView.getMap();

    //普通地圖
    // mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);

    //衛星地圖
    mBaiduMap.setMapType(BaiduMap.MAP_TYPE_SATELLITE);

    //空白地圖, 基礎地圖瓦片將不會被渲染。在地圖類型中設置為NONE,將不會使用流量下載基礎地圖瓦片圖層。使用場景:與瓦片圖層一起使用,節省流量,提升自定義瓦片圖下載速度。
    // mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NONE);
}
 
開發者ID:zhangxx0,項目名稱:FirstCodeUtil,代碼行數:21,代碼來源:AtyLocationBaiduMap.java

示例9: onCreateView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_freight_track_map_with_webview, container, false);

        mFreightId = getArguments().getString(ARGUMENT_FREIGHT_ID);
        mFreightName = getArguments().getString(ARGUMENT_FREIGHT_NAME);

        FloatingActionButton fab = (FloatingActionButton) getActivity().findViewById(R.id.fab);
        fab.setOnClickListener(__ -> mPresenter.loadFreightDataListDetail(mIsFreightTrackMode));

        bmapView = (MapView) view.findViewById(R.id.bmapView);
        webView = (WebView) view.findViewById(R.id.webView);

        //根據當前係統語言設置加載不同的Map Ui
        mUsingWebView = "zh-CN".equals(LanguageUtil.getLanguage()) ? false : true;
//        mUsingWebView = true; //for test webviewMap
        setupMapUi(mUsingWebView);
        if (mUsingWebView) {
            setupWebView();
        }

        mHandler = new Handler();
        return view;
    }
 
開發者ID:agenthun,項目名稱:ESeal,代碼行數:27,代碼來源:FreightTrackMapWithWebViewFragment.java

示例10: onCreateView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_freight_track_map, container, false);

    mFreightId = getArguments().getString(ARGUMENT_FREIGHT_ID);
    mFreightName = getArguments().getString(ARGUMENT_FREIGHT_NAME);

    FloatingActionButton fab = (FloatingActionButton) getActivity().findViewById(R.id.fab);
    fab.setOnClickListener(mOnFabClickListener);

    bmapView = (MapView) view.findViewById(R.id.bmapView);

    mHandler = new Handler();
    return view;
}
 
開發者ID:agenthun,項目名稱:ESeal,代碼行數:18,代碼來源:FreightTrackMapFragment.java

示例11: onCreateView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_freight_track_google_map, container, false);

    mFreightId = getArguments().getString(ARGUMENT_FREIGHT_ID);
    mFreightName = getArguments().getString(ARGUMENT_FREIGHT_NAME);

    FloatingActionButton fab = (FloatingActionButton) getActivity().findViewById(R.id.fab);
    fab.setOnClickListener(mOnFabClickListener);

    bmapView = (MapView) view.findViewById(R.id.bmapView);
    googleMapView = (com.google.android.gms.maps.MapView) view.findViewById(R.id.googleMapView);

    mHandler = new Handler();
    return view;
}
 
開發者ID:agenthun,項目名稱:ESeal,代碼行數:19,代碼來源:FreightTrackGoogleMapFragment.java

示例12: OnInitUiAndData

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
protected void OnInitUiAndData() {
    super.OnInitUiAndData();

    mMapView = (MapView) findViewById(R.id.bmapView);
    mBaiduMap = mMapView.getMap();
    ll_back_on_mapactivity = (LinearLayout) findViewById(R.id.ll_back_on_mapactivity);
    fl_mapactivity = (FrameLayout) findViewById(R.id.fl_mapactivity);
    btSearch = (Button) findViewById(R.id.btSearch);
    btClear = (Button) findViewById(R.id.btClear);
    btLoca = (Button) findViewById(R.id.btLoca);
    dialog_show = LayoutInflater.from(this).inflate(R.layout.dialog_show, null);
    etFrom = (EditTextWithFrame) dialog_show.findViewById(R.id.etFrom);
    etEnd = (EditTextWithFrame) dialog_show.findViewById(R.id.etEnd);

}
 
開發者ID:CrazyRunning,項目名稱:MyStudyHelper,代碼行數:17,代碼來源:MapActivity.java

示例13: initView

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
private void initView() {
    mMapView = (MapView) findViewById(R.id.id_bmapView);
    mBaiduMap = mMapView.getMap();
    MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(17.0f);//縮放等級17=100m
    mBaiduMap.setMapStatus(msu);
    mLocationMode = MyLocationConfiguration.LocationMode.NORMAL;
    //隱藏縮放控件和百度logo
    int childCount = mMapView.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = mMapView.getChildAt(i);
        if (child instanceof ZoomControls || child instanceof ImageView) {
            child.setVisibility(View.GONE);
        }
    }
    //改變比例尺的位置
    final int screenheight = this.getWindowManager().getDefaultDisplay().getHeight();
    mBaiduMap.setOnMapLoadedCallback(new BaiduMap.OnMapLoadedCallback() {

        @Override
        public void onMapLoaded() {
            mMapView.setScaleControlPosition(new Point(200, screenheight - 307));
        }
    });
}
 
開發者ID:PengZhiPeng,項目名稱:Mooc-map,代碼行數:25,代碼來源:MainActivity.java

示例14: onCreate

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_location);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    mVisible = true;
    mControlsView = findViewById(R.id.fullscreen_content_controls);
    mMapView = (MapView) findViewById(R.id.location_map_view);

    setupMapView(mMapView);

}
 
開發者ID:legendmohe,項目名稱:LEHomeMobile_android,代碼行數:18,代碼來源:LocationActivity.java

示例15: initViews

import com.baidu.mapapi.map.MapView; //導入依賴的package包/類
@Override
protected void initViews() {
    SDKInitializer.initialize(getApplicationContext());

    setContentView(R.layout.activity_hospital_periphery_navigation);
    setTitleBack("周邊商戶");
    rbDrug = (RadioButton) findViewById(R.id.rb_drug);
    rbHotel = (RadioButton) findViewById(R.id.rb_hotel);
    rbBank = (RadioButton) findViewById(R.id.rb_bank);
    rbIce = (RadioButton) findViewById(R.id.rb_ice);
    mMapView = (MapView) findViewById(R.id.mv);
    mBaiduMap = mMapView.getMap();
    //普通地圖
    mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
    //設定中心點坐標
    LatLng centerPoint = new LatLng(31.3023280000, 120.5906890000);
    //定義地圖狀態
    MapStatus mMapStatus = new MapStatus.Builder()
            .target(centerPoint)
            .zoom(18)
            .build();
    //定義MapStatusUpdate對象,以便描述地圖狀態將要發生的變化
    MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
    //改變地圖狀態
    mBaiduMap.setMapStatus(mMapStatusUpdate);
}
 
開發者ID:mjd507,項目名稱:zsyy,代碼行數:27,代碼來源:HospitalPeripheryNavigationActivity.java


注:本文中的com.baidu.mapapi.map.MapView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。