本文整理汇总了Java中com.amap.api.maps2d.MapView类的典型用法代码示例。如果您正苦于以下问题:Java MapView类的具体用法?Java MapView怎么用?Java MapView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapView类属于com.amap.api.maps2d包,在下文中一共展示了MapView类的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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例7: initView
import com.amap.api.maps2d.MapView; //导入依赖的package包/类
void initView() {
mMapView = (MapView) findViewById(R.id.map);
mLocbtn = (AppCompatImageButton) findViewById(R.id.locbtn);
mActionLocate = (FloatingActionButton) findViewById(R.id.action_locate);
mActionSettings = (FloatingActionButton) findViewById(R.id.action_settings);
mActionReminder = (FloatingActionButton) findViewById(R.id.action_reminder);
mFloatingActionsMenu = (FloatingActionsMenu) findViewById(R.id.floating_actions_menu);
mInfoTextView = (TextView) findViewById(R.id.info_text_view);
mActionLocate.setOnClickListener(this);
mActionSettings.setOnClickListener(this);
mActionReminder.setOnClickListener(this);
mLocbtn.setOnClickListener(this);
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: initView
import com.amap.api.maps2d.MapView; //导入依赖的package包/类
@Override
protected MapView initView(Bundle savedInstanceState) {
MapView mapView = (MapView) findViewById(R.id.map);
horizontalScrollView = (RealTimeLocationHorizontalScrollView) findViewById(R.id.scroll_view);
mExitImageView = (ImageView) findViewById(android.R.id.icon);
mCloseImageView = (ImageView) findViewById(android.R.id.icon1);
mExitImageView.setOnClickListener(this);
mCloseImageView.setOnClickListener(this);
mParticipantTextView = (TextView) findViewById(android.R.id.text1);
mLayout= (RelativeLayout) findViewById(R.id.layout);
mLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// Log.d("RealTimeLocation", "--onTouch-------------");
return true;
}
});
EventBus.getDefault().register(this);
int type = getIntent().getIntExtra("conversationType", 0);
targetId = getIntent().getStringExtra("targetId");
conversationType = Conversation.ConversationType.setValue(type);
return mapView;
}
示例12: 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;
}
示例13: 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);// 必须要写
}
示例14: 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();
}
示例15: 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();
}