当前位置: 首页>>代码示例>>Java>>正文


Java MapView.onCreate方法代码示例

本文整理汇总了Java中com.amap.api.maps2d.MapView.onCreate方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.onCreate方法的具体用法?Java MapView.onCreate怎么用?Java MapView.onCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amap.api.maps2d.MapView的用法示例。


在下文中一共展示了MapView.onCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    IntentFilter filter = new IntentFilter();
    filter.addAction(DJIDemoApplication.FLAG_CONNECTION_CHANGE);
    registerReceiver(mReceiver, filter);

    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);

    initMapView();
    initUI();
    addListener();

}
 
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-GSDemo-Gaode-Map,代码行数:19,代码来源:MainActivity.java

示例2: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_searchlocation);
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 必须要写
    Intent intent = getIntent();
    keyWord = intent.getStringExtra("keyWord");
    city = intent.getStringExtra("city");
    pz = intent.getIntExtra("count", 1);
    if (TextUtils.isEmpty(keyWord)) {
        keyWord = "中科汇联信息技术有限公司";
    }
    if (TextUtils.isEmpty(city)) {
        city = "北京";
    }
    init();
}
 
开发者ID:treejames,项目名称:Map4amap,代码行数:19,代码来源:SearchLocationMap.java

示例3: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_locationplusmap);
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 必须要写

    Intent intent = getIntent();
    keyWord = intent.getStringExtra("keyWord");
    city = intent.getStringExtra("city");
    pz = intent.getIntExtra("count", 1);
    if (TextUtils.isEmpty(keyWord)) {
        keyWord = "中科汇联信息技术有限公司";
    }
    if (TextUtils.isEmpty(city)) {
        city = "北京";
    }
    initId();
    init();
}
 
开发者ID:treejames,项目名称:Map4amap,代码行数:21,代码来源:LocationPlusMap.java

示例4: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // When the compile and target version is higher than 22, please request the
    // following permissions at runtime to ensure the
    // SDK work well.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        ActivityCompat.requestPermissions(this,
                new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.VIBRATE,
                        Manifest.permission.INTERNET, Manifest.permission.ACCESS_WIFI_STATE,
                        Manifest.permission.WAKE_LOCK, Manifest.permission.ACCESS_COARSE_LOCATION,
                        Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION,
                        Manifest.permission.CHANGE_WIFI_STATE, Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS,
                        Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SYSTEM_ALERT_WINDOW,
                        Manifest.permission.READ_PHONE_STATE,
                }
                , 1);
    }

    setContentView(R.layout.activity_way_point);

    IntentFilter filter = new IntentFilter();
    filter.addAction(DJIDemoApplication.FLAG_CONNECTION_CHANGE);
    registerReceiver(mReceiver, filter);

    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);

    initMapView();
    initUI();
    addListener();

}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:35,代码来源:WayPointActivity.java

示例5: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.map_view_amap_layout);
      mapView = (MapView) findViewById(R.id.autonavi_mapView);
  	mapView.onCreate(savedInstanceState);// 此方法必须重写

ToolBarOptions options = new ToolBarOptions();
setToolBar(R.id.toolbar, options);

  	initView();
      initAmap();
      initLocation();
      updateSendStatus();
  }
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:16,代码来源:LocationAmapActivity.java

示例6: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.map_view_amap_navigation_layout);
	mapView = (MapView) findViewById(R.id.autonavi_mapView);
	mapView.onCreate(savedInstanceState);// 此方法必须重写

	ToolBarOptions options = new ToolBarOptions();
	setToolBar(R.id.toolbar, options);

	initView();
	initAmap();
	initLocation();
	updateSendStatus();
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:16,代码来源:NavigationAmapActivity.java

示例7: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.find_around_layout);

        mapView = (MapView) findViewById(R.id.map);  //显示地图
        mapView.onCreate(savedInstanceState);   //必须要写
        aMap = mapView.getMap();    //获取地图对象

        initViews();
        EventDeal();
    }
 
开发者ID:absentm,项目名称:myapplication,代码行数:14,代码来源:FindMapAroundAty.java

示例8: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mMapView=(MapView)findViewById(R.id.primary_map);
    city_btn =(Button)findViewById(R.id.city_name);
    main_content =(TextView)findViewById(R.id.main_content);
    mMapView.onCreate(savedInstanceState);

    init();
}
 
开发者ID:Abitalo,项目名称:WeatherDemo,代码行数:13,代码来源:MainActivity.java

示例9: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.activity_share_location);
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 此方法必须重写

    init();
}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:13,代码来源:ShareLocationActivity.java

示例10: onCreateView

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_main_map_layout, container, false);

    //显示地图
    mapView = (MapView) rootView.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    aMap = mapView.getMap();
    initMap();
    //跳转至发帖页
    publishButton = (FloatingActionButton) rootView.findViewById(R.id.main_map_publish_button);
    publishButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (!LoginStatus.getIsUserMode()) {
                GreenToast.makeText(getActivity(), getResources().getString(R.string.please_login_first), Toast.LENGTH_LONG).show();
                return;
            } else if (CommonUtil.isEmptyString(LocationInfo.getAddress()) ||
                    CommonUtil.isEmptyString(LocationInfo.getCityName()) ||
                    CommonUtil.isEmptyString(String.valueOf(LocationInfo.getLat()))) {

                GreenToast.makeText(getActivity(), getResources().getString(R.string.can_not_get_your_location), Toast.LENGTH_LONG).show();
                return;
            }
            getActivity().startActivityForResult(new Intent(getActivity(), PublishActivity.class), IntentUtil.TO_PUBLISH_PAGE);
        }
    });

    return rootView;
}
 
开发者ID:chenjunqian,项目名称:here,代码行数:32,代码来源:MainMapFragment.java

示例11: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_simple);
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 必须要写

}
 
开发者ID:treejames,项目名称:Map4amap,代码行数:9,代码来源:SimpleMap.java

示例12: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_locationmap);
    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 必须要写
    initId();
    init();
}
 
开发者ID:treejames,项目名称:Map4amap,代码行数:10,代码来源:LocationMap.java

示例13: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_content_activity);
	setActionbar();
	mapView = (MapView) findViewById(R.id.map);
	mapView.onCreate(savedInstanceState); // 此方法必须重写
	
	int index = this.getIntent().getExtras().getInt("INDEX");
	Log.i(TAG, "------->index:"+index);
	setContent();
	
}
 
开发者ID:SimonJoker,项目名称:OnTheRoad,代码行数:15,代码来源:ActivityContentAcvitity.java

示例14: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gaode_map);
    mapView = (MapView) findViewById(R.id.map);
    LogHelper.e("gaode", "create");
    mapView.onCreate(savedInstanceState);// 必须要写 init();
    init();
    LogHelper.e("gaode", "init");
    container = findViewById(R.id.container);
    findViewById(R.id.mark_tv).setVisibility(View.GONE);
    if (!readIntent()) {
        LogHelper.e("gaode", "select");
        getSupportActionBar().setCustomView(R.layout.ct_action_search);
        getSupportActionBar().setDisplayShowCustomEnabled(true);
        getSupportActionBar().collapseActionView();
        SearchView searchView = (SearchView) getSupportActionBar().getCustomView().findViewById(R.id.search_view);
        searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
        searchView.onActionViewCollapsed();
        getSupportActionBar().getCustomView().findViewById(R.id.confirm).setVisibility(View.GONE);
        getSupportActionBar().getCustomView().findViewById(R.id.confirm).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                queryAndSave(currentItem.getLatLonPoint().getLatitude(),
                        currentItem.getLatLonPoint().getLongitude(),
                        currentItem.getTitle()
                );
            }
        });
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

            public boolean onQueryTextSubmit(String query) {

                search(query);
                return true;
            }

            public boolean onQueryTextChange(String newText) {
                return true;
            }
        });
        move(25.044061, 121.510841);
    } else {
        LogHelper.e("gaode", "show");
        mapView.postDelayed(new Runnable() {
            @Override
            public void run() {
                moveAndMark(lat, lng, name);
            }
        }, 300);
        LogHelper.e("gaode", "show ok");
    }
    getSupportActionBar().show();
    supportInvalidateOptionsMenu();
    LogHelper.e("gaode", "done");
}
 
开发者ID:MoonRune,项目名称:CuiTrip,代码行数:57,代码来源:GaoDeMapActivity.java

示例15: onCreate

import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_locationandapois);

    System.out.println("打开 five");

    mapView = (MapView) findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);// 必须要写
    Intent intent = getIntent();
    ArrayList<PoiItem> pois = intent.getParcelableArrayListExtra("apois");
    lp = intent.getParcelableExtra("lp");

    String title = intent.getStringExtra("title");
    if (!TextUtils.isEmpty(title))
        ((TextView) findViewById(R.id.tv_title)).setText(title);
    initAmap();

    if (pois != null && pois.size() > 0) {
        aMap.clear();// 清理之前的图标
        poiOverlay = new PoiOverlay(aMap, pois);
        poiOverlay.removeFromMap();
        poiOverlay.addToMap();
        poiOverlay.zoomToSpan();

        aMap.setOnMarkerClickListener(this);
        poiItem = pois.get(0);
    }
    if (lp != null) {
        MarkerOptions mo = new MarkerOptions();
        mo.title("我的位置");
        mo.position(new LatLng(lp.getLatitude(), lp.getLongitude()));
        mo.icon(BitmapDescriptorFactory.fromResource(R.drawable.location_marker));
        aMap.addMarker(mo);
    }

    //TODO 找路线
    findViewById(R.id.btn_route).setOnClickListener(this);
    findViewById(R.id.ib_back).setOnClickListener(this);

}
 
开发者ID:treejames,项目名称:Map4amap,代码行数:42,代码来源:LocationAndApois.java


注:本文中的com.amap.api.maps2d.MapView.onCreate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。