コード例 #1
0
 private void initView(Bundle savedInstanceState) {
   station_mapview.onCreate(savedInstanceState);
   aMap = station_mapview.getMap();
   aMap.setOnMarkerClickListener(this);
   aMap.setOnMarkerDragListener(this);
   aMap.setOnMapLoadedListener(this);
   aMap.setOnCameraChangeListener(this);
 }
コード例 #2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.layers_activity);
   mapView = (MapView) findViewById(R.id.map);
   mapView.onCreate(savedInstanceState); // 此方法必须重写
   init();
 }
コード例 #3
0
ファイル: PoiMapActivity.java プロジェクト: LindenKrebs/Demo
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_poi_map);

    setupToolBar();

    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    aMap = mapView.getMap();
  }
コード例 #4
0
ファイル: MainActivity.java プロジェクト: Jkand/Parking123456
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // 在onCreat方法中给aMap对象赋值
    setContentView(R.layout.activity_main);

    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState); // 必须要写
    aMap = mapView.getMap();
    initMap();
    initMapButton();
    initTitleButton();
  }
コード例 #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_travel_planning);

    ActionBar actionBar = getSupportActionBar();
    // 使用up 箭头指示器显示home
    actionBar.setDisplayHomeAsUpEnabled(true);
    // 设置title 文本
    actionBar.setTitle("乐途记");

    travelPlanningPresenter = new TravelPlanningPresenter();
    travelPlanningPresenter.setView(this);
    mapView = (MapView) findViewById(R.id.map1);
    mapView.onCreate(savedInstanceState);
    init();

    addMapListener(); // 向地图添加单击事件监听器
    setUpMap();
  }
コード例 #6
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.issue_gaodeditu);
   Intent intent = getIntent();
   isChooseAddress = intent.getBooleanExtra("isChooseAddress", false);
   mapView = (MapView) findViewById(R.id.map);
   mapView.onCreate(savedInstanceState); // 此方法必须重写
   sharedPreferences = getSharedPreferences(Constants.LOGIN_PREFERENCE, Context.MODE_PRIVATE);
   locationCity = sharedPreferences.getString("LocationCity", "北京");
   getActionBar().setTitle(locationCity);
   getActionBar().setHomeButtonEnabled(true);
   getActionBar().setDisplayHomeAsUpEnabled(true);
   getActionBar().setDisplayShowHomeEnabled(true);
   init();
   String LocationXStr = sharedPreferences.getString("LocationX", "");
   String locationYStr = sharedPreferences.getString("LocationY", "");
   if (isChooseAddress) {
     locationX = intent.getDoubleExtra("LocationX", 0.0);
     locationY = intent.getDoubleExtra("LocationY", 0.0);
     locationCity = intent.getStringExtra("LocationCityName");
     latLng = new LatLng(locationX, locationY);
     latLonPoint = AMapUtil.convertToLatLonPoint(latLng);
     aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18)); // 设置当前地图显示为北京市恭王府
     getAddress(latLonPoint);
     doSearchQuery(latLonPoint);
     regeoMarker.setPosition(latLng);
   } else {
     if (!TextUtils.isEmpty(LocationXStr) && !TextUtils.isEmpty(locationYStr)) {
       locationX = Double.parseDouble(LocationXStr);
       locationY = Double.parseDouble(locationYStr);
       latLng = new LatLng(locationX, locationY);
       latLonPoint = AMapUtil.convertToLatLonPoint(latLng);
       aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18));
       getAddress(latLonPoint);
       doSearchQuery(latLonPoint);
       regeoMarker.setPosition(latLng);
     }
   }
 }