if (layerlist.contains(local)){ Log.e("set1","包含遥感影像图层"); setting_bt2.setBackground(getResources().getDrawable(R.color.setting_bt_color)); setting_bt2.setTextColor(getResources().getColor(R.color.setting_txt_color)); }else{ Log.e("set1","不包含遥感影像图层"); setting_bt2.setBackground(getResources().getDrawable(R.color.setting_txt_color)); setting_bt2.setTextColor(getResources().getColor(R.color.setting_bt_color)); } if (layerlist.contains(local1)){ Log.e("set1","包含地图图层"); setting_bt1.setBackground(getResources().getDrawable(R.color.setting_bt_color)); setting_bt1.setTextColor(getResources().getColor(R.color.setting_txt_color)); }else{ Log.e("set1","不包含地图图层"); setting_bt1.setBackground(getResources().getDrawable(R.color.setting_txt_color)); setting_bt1.setTextColor(getResources().getColor(R.color.setting_bt_color)); } setting_bt1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (layerlist.contains(local1)){ setting_bt1.setBackground(getResources().getDrawable(R.color.setting_txt_color)); setting_bt1.setTextColor(getResources().getColor(R.color.setting_bt_color)); mMapView.removeLayer(local1); layerlist.remove(local1); Log.e("layerlist","layerlist is :"+layerlist); }else{ setting_bt1.setBackground(getResources().getDrawable(R.color.setting_bt_color)); setting_bt1.setTextColor(getResources().getColor(R.color.setting_txt_color)); mMapView.addLayer(local1); layerlist.add(local1); } } }); setting_bt2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (layerlist.contains(local)){ setting_bt2.setBackground(getResources().getDrawable(R.color.setting_txt_color)); setting_bt2.setTextColor(getResources().getColor(R.color.setting_bt_color)); mMapView.removeLayer(local); layerlist.remove(local); }else{ setting_bt2.setBackground(getResources().getDrawable(R.color.setting_bt_color)); setting_bt2.setTextColor(getResources().getColor(R.color.setting_txt_color)); mMapView.addLayer(local); layerlist.add(local); } } });
Android ArcGis 地图图层切换
最新推荐文章于 2023-08-07 14:40:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)