marker图形修改,接口联调,以及上报marker的处理
@ -89,7 +89,7 @@ public class Constant {
|
|||||||
public static LatLng markerLatlng;
|
public static LatLng markerLatlng;
|
||||||
//marker 图标
|
//marker 图标
|
||||||
|
|
||||||
public static BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.poi_icons);
|
public static final BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
|
||||||
public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||||
public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
||||||
public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
@ -91,6 +91,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
private int pid;
|
private int pid;
|
||||||
private String station;
|
private String station;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
|
private LatLng poiLatLng;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@ -157,7 +158,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (isChecked){
|
if (isChecked){
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.MAIN_CHARGING_PILE;
|
obtain.what = Constant.MAIN_CHARGING_PILE;
|
||||||
obtain.obj = latLng;
|
obtain.obj = poiLatLng;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}else {
|
}else {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -370,7 +371,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
editDescribe = findViewById(R.id.edit_describe);
|
editDescribe = findViewById(R.id.edit_describe);
|
||||||
btnSaveLocal = findViewById(R.id.btn_save_local);
|
btnSaveLocal = findViewById(R.id.btn_save_local);
|
||||||
btnSaveLocal.setOnClickListener(this::onClick);
|
btnSaveLocal.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
//展示数据
|
//展示数据
|
||||||
initShowPileSharePre();
|
initShowPileSharePre();
|
||||||
|
|
||||||
@ -381,6 +381,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (station!=null){
|
if (station!=null){
|
||||||
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
||||||
pid = poiEntity.getTaskId();
|
pid = poiEntity.getTaskId();
|
||||||
|
String x = poiEntity.getX();
|
||||||
|
String y = poiEntity.getY();
|
||||||
|
if (x != null && y != null) {
|
||||||
|
poiLatLng = new LatLng();
|
||||||
|
poiLatLng.setLatitude(Double.parseDouble(y));
|
||||||
|
poiLatLng.setLongitude(Double.parseDouble(x));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
||||||
|
@ -263,14 +263,17 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
} else if (Constant.TASK_STASTUS == 3) {
|
} else if (Constant.TASK_STASTUS == 3) {
|
||||||
tvType.setText("未领取");
|
tvType.setText("未领取");
|
||||||
}
|
}
|
||||||
|
|
||||||
btnFilter = findViewById(R.id.btn_filter);
|
btnFilter = findViewById(R.id.btn_filter);
|
||||||
btnFilter.setOnClickListener(this::onClick);
|
btnFilter.setOnClickListener(this::onClick);
|
||||||
recyclerFilter = findViewById(R.id.recycler_filter);
|
recyclerFilter = findViewById(R.id.recycler_filter);
|
||||||
|
|
||||||
//设置下划线
|
//设置下划线
|
||||||
recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerFilter.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
recyclerFilter.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||||
recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin);
|
recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin);
|
||||||
recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||||
|
|
||||||
//取消上啦加载下拉刷新
|
//取消上啦加载下拉刷新
|
||||||
recyclerFilter.setPullRefreshEnabled(false);
|
recyclerFilter.setPullRefreshEnabled(false);
|
||||||
recyclerFilter.setLoadingMoreEnabled(false);
|
recyclerFilter.setLoadingMoreEnabled(false);
|
||||||
@ -281,10 +284,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMore() {
|
public void onLoadMore() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
||||||
@ -301,10 +305,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
obtain.obj = poiEntity;
|
obtain.obj = poiEntity;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -338,7 +340,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -366,13 +367,15 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1 "POI"
|
1 "POI"
|
||||||
* 2 "充电站"
|
2 "充电站"
|
||||||
* 3 "POI录像"
|
3 "POI录像"
|
||||||
* 4 "道路录像"
|
4 "道路录像"
|
||||||
* 5 "其他"
|
5 "其他"
|
||||||
* 6 "面状任务"
|
6 "面状任务"
|
||||||
*/
|
*/
|
||||||
case R.id.cl_exclusive:
|
case R.id.cl_exclusive:
|
||||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
||||||
|
@ -41,11 +41,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
||||||
private PoiEntity poiEntity;
|
private PoiEntity poiEntity;
|
||||||
private PoiDao poiDao;
|
private PoiDao poiDao;
|
||||||
private PoiEntity poiListEntity;
|
|
||||||
private int aSave;
|
|
||||||
private PoiEntity polygonEntity;
|
|
||||||
private ChargingPileDao chargingPileDao;
|
private ChargingPileDao chargingPileDao;
|
||||||
|
|
||||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||||
GatherGetFragment fragment = new GatherGetFragment();
|
GatherGetFragment fragment = new GatherGetFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
@ -161,11 +157,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (poiListEntity != null) {
|
|
||||||
poiDao.deletePoiEntity(poiListEntity);
|
|
||||||
} else {
|
|
||||||
poiDao.deletePoiEntity(poiEntity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
@ -202,9 +194,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId());
|
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
}else {
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
|
||||||
btnGather.setVisibility(View.GONE);
|
|
||||||
if (poiEntity.getType() == 1) {//poi的领取类型
|
if (poiEntity.getType() == 1) {//poi的领取类型
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), true);
|
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), true);
|
||||||
} else if (poiEntity.getType() == 5) {//其他的领取类型
|
} else if (poiEntity.getType() == 5) {//其他的领取类型
|
||||||
@ -212,6 +202,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}else if (poiEntity.getType() == 2){//充电站的领取类型
|
}else if (poiEntity.getType() == 2){//充电站的领取类型
|
||||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),true);
|
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),true);
|
||||||
}
|
}
|
||||||
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
|
btnGather.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -226,11 +218,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (poiListEntity != null) {
|
|
||||||
poiDao.deletePoiEntity(poiListEntity);
|
|
||||||
} else {
|
|
||||||
poiDao.deletePoiEntity(poiEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@ -303,7 +291,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
if (isSaver && aSave == 1) {
|
if (isSaver) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.GATHER_GET_MAP;
|
obtain.what = Constant.GATHER_GET_MAP;
|
||||||
obtain.obj = chargingListEntity;
|
obtain.obj = chargingListEntity;
|
||||||
@ -353,16 +341,16 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||||
poiListEntity.setX(latLng.longitude + "");
|
polygonEntity.setX(latLng.longitude + "");
|
||||||
poiListEntity.setY(latLng.latitude + "");
|
polygonEntity.setY(latLng.latitude + "");
|
||||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||||
poiListEntity.setX(latLineString.get(0).longitude + "");
|
polygonEntity.setX(latLineString.get(0).longitude + "");
|
||||||
poiListEntity.setY(latLineString.get(0).latitude + "");
|
polygonEntity.setY(latLineString.get(0).latitude + "");
|
||||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
polygonEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
polygonEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
}
|
}
|
||||||
polygonEntity.setTaskStatus(1);
|
polygonEntity.setTaskStatus(1);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -549,7 +537,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
if (isSaver && aSave == 1) {
|
if (isSaver) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.GATHER_GET_MAP;
|
obtain.what = Constant.GATHER_GET_MAP;
|
||||||
obtain.obj = poiListEntity;
|
obtain.obj = poiListEntity;
|
||||||
|
@ -368,7 +368,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
switch (Integer.valueOf(list.get(i).getType())) {
|
switch (Integer.valueOf(list.get(i).getType())) {
|
||||||
case 1://poi
|
case 1://poi
|
||||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
|
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
|
||||||
|
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
poiMarker.setTag(listBean);
|
poiMarker.setTag(listBean);
|
||||||
@ -376,7 +377,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
poiMarker.setClickable(true);
|
poiMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 2://充电站
|
case 2://充电站
|
||||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
|
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
||||||
|
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
stationMarker.setTag(listBean);
|
stationMarker.setTag(listBean);
|
||||||
@ -384,9 +386,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
stationMarker.setClickable(true);
|
stationMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 3://poi录像
|
case 3://poi录像
|
||||||
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
|
||||||
|
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiVideoMarker.setTag(listBean);
|
||||||
|
removables.add(poiVideoMarker);
|
||||||
|
poiVideoMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 4://道路录像
|
case 4://道路录像
|
||||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||||
|
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
roadMarker.setTag(listBean);
|
roadMarker.setTag(listBean);
|
||||||
@ -394,9 +404,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
roadMarker.setClickable(true);
|
roadMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 5://其他
|
case 5://其他
|
||||||
|
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
otherMarker.setTag(listBean);
|
||||||
|
removables.add(otherMarker);
|
||||||
|
otherMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 6://面状任务
|
case 6://面状任务
|
||||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
|
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
Log.d("面妆任务", "onSuccess: " + planarMarker);
|
Log.d("面妆任务", "onSuccess: " + planarMarker);
|
||||||
@ -465,13 +483,69 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
showAllPoi.clear();
|
showAllPoi.clear();
|
||||||
showAllPoi.addAll(allTaskStatus);
|
showAllPoi.addAll(allTaskStatus);
|
||||||
for (int i = 0; i < allTaskStatus.size(); i++) {
|
for (int i = 0; i < allTaskStatus.size(); i++) {
|
||||||
if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) {
|
PoiEntity poiEntity = allTaskStatus.get(i);
|
||||||
LatLng position = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX()));
|
LatLng latLng = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX()));
|
||||||
Marker marker = tencentMap.addMarker(new MarkerOptions(position));
|
switch (Integer.valueOf(poiEntity.getType())) {
|
||||||
marker.setClickable(true);
|
case 1://poi
|
||||||
marker.setTitle("本地");//1:本地
|
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg);
|
||||||
marker.setTag(allTaskStatus.get(i));
|
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f)
|
||||||
removablesLocality.add(marker);
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiMarker.setClickable(true);
|
||||||
|
poiMarker.setTitle("本地");//1:本地
|
||||||
|
poiMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(poiMarker);
|
||||||
|
break;
|
||||||
|
case 2://充电站
|
||||||
|
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_have_bg);
|
||||||
|
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
stationMarker.setClickable(true);
|
||||||
|
stationMarker.setTitle("本地");//1:本地
|
||||||
|
stationMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(stationMarker);
|
||||||
|
break;
|
||||||
|
case 3://poi录像
|
||||||
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
||||||
|
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiVideoMarker.setClickable(true);
|
||||||
|
poiVideoMarker.setTitle("本地");//1:本地
|
||||||
|
poiVideoMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(poiVideoMarker);
|
||||||
|
break;
|
||||||
|
case 4://道路录像
|
||||||
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_have_bg);
|
||||||
|
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
roadMarker.setClickable(true);
|
||||||
|
roadMarker.setTitle("本地");//1:本地
|
||||||
|
roadMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(roadMarker);
|
||||||
|
break;
|
||||||
|
case 5://其他
|
||||||
|
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg);
|
||||||
|
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
otherMarker.setClickable(true);
|
||||||
|
otherMarker.setTitle("本地");//1:本地
|
||||||
|
otherMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(otherMarker);
|
||||||
|
break;
|
||||||
|
case 6://面状任务
|
||||||
|
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg);
|
||||||
|
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f)
|
||||||
|
.clockwise(false)
|
||||||
|
.flat(true));
|
||||||
|
planarMarker.setClickable(true);
|
||||||
|
planarMarker.setTitle("本地");//1:本地
|
||||||
|
planarMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(planarMarker);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -674,7 +748,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
initCheckedMarker(Constant.CHARGING_STATION_WORD);
|
initCheckedMarker(Constant.CHARGING_STATION_WORD);
|
||||||
}
|
}
|
||||||
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
|
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
|
||||||
initPoiMarker((LatLng) data.obj);
|
initPileMarker((LatLng) data.obj);
|
||||||
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置
|
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置
|
||||||
if((boolean)data.obj){
|
if((boolean)data.obj){
|
||||||
initCheckedMarker(Constant.CHARGING_PILE_WORD);
|
initCheckedMarker(Constant.CHARGING_PILE_WORD);
|
||||||
@ -790,6 +864,29 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
private void initPileMarker(LatLng latLng) {
|
||||||
|
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||||
|
latLng, //中心点坐标,地图目标经纬度
|
||||||
|
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||||
|
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||||
|
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
||||||
|
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
screenPosition = tencentMap.getProjection().toScreenLocation(latLng);
|
||||||
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
|
//创建Marker对象之前,设置属性
|
||||||
|
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng));
|
||||||
|
markerPoi.setFixingPoint(screenPosition.x, screenPosition.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCheckedMarker(int poiWord) {
|
private void initCheckedMarker(int poiWord) {
|
||||||
@ -807,6 +904,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* 设置定位图标样式
|
* 设置定位图标样式
|
||||||
*/
|
*/
|
||||||
private void setLocMarkerStyle() {
|
private void setLocMarkerStyle() {
|
||||||
@ -1086,7 +1184,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public LatLng getMapCenter() {
|
public LatLng getMapCenterPoint() {
|
||||||
// int left = treasureMap.getLeft();
|
// int left = treasureMap.getLeft();
|
||||||
// int top = treasureMap.getTop();
|
// int top = treasureMap.getTop();
|
||||||
// int right = treasureMap.getRight();
|
// int right = treasureMap.getRight();
|
||||||
@ -1099,23 +1197,5 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
return tencentMap.getCameraPosition().target;
|
return tencentMap.getCameraPosition().target;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取屏幕中心点位置
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public LatLng getMapCenterPoint() {
|
|
||||||
int left = treasureMap.getLeft();
|
|
||||||
int top = treasureMap.getTop();
|
|
||||||
int right = treasureMap.getRight();
|
|
||||||
int bottom = treasureMap.getBottom();
|
|
||||||
// 获得屏幕点击的位置
|
|
||||||
int x = (int) (treasureMap.getX() + (right - left) / 2);
|
|
||||||
int y = (int) (treasureMap.getY() + (bottom - top) / 2);
|
|
||||||
Projection projection = tencentMap.getProjection();
|
|
||||||
LatLng pt = projection.fromScreenLocation(new Point(x, y));
|
|
||||||
return pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
BIN
app/src/main/res/drawable/marker_charge_centre_bg.png
Normal file
After Width: | Height: | Size: 937 B |
BIN
app/src/main/res/drawable/marker_charge_have_bg.png
Normal file
After Width: | Height: | Size: 893 B |
BIN
app/src/main/res/drawable/marker_other_have_bg.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
app/src/main/res/drawable/marker_pile_bg.png
Normal file
After Width: | Height: | Size: 802 B |
BIN
app/src/main/res/drawable/marker_pile_centre_bg.png
Normal file
After Width: | Height: | Size: 806 B |
BIN
app/src/main/res/drawable/marker_pile_have_bg.png
Normal file
After Width: | Height: | Size: 832 B |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 844 B |
BIN
app/src/main/res/drawable/marker_poi_have_bg.png
Normal file
After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 5.6 KiB |
BIN
app/src/main/res/drawable/marker_road_have_bg.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 391 B |
BIN
app/src/main/res/drawable/poi_video_bg.png
Normal file
After Width: | Height: | Size: 873 B |
BIN
app/src/main/res/drawable/poi_video_have_bg.png
Normal file
After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 716 B |
@ -23,9 +23,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
android:focusable="false"
|
|
||||||
android:focusableInTouchMode="false"
|
android:focusableInTouchMode="false"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:focusable="false"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/frame_layout"
|
app:layout_constraintBottom_toTopOf="@+id/frame_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
@ -42,16 +42,17 @@
|
|||||||
android:background="@drawable/ic_baseline_add_alert"
|
android:background="@drawable/ic_baseline_add_alert"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
</ImageView>
|
</ImageView>
|
||||||
<!-- <TextView-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
<!--<TextView-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!--android:layout_width="wrap_content"-->
|
||||||
<!-- android:text="10"-->
|
<!--android:layout_height="wrap_content"-->
|
||||||
<!-- android:background="@drawable/small_bell_text"-->
|
<!--android:text="10"-->
|
||||||
<!-- android:textColor="@color/white"-->
|
<!--android:background="@drawable/small_bell_text"-->
|
||||||
<!-- app:layout_constraintTop_toTopOf="@+id/iv_message"-->
|
<!--android:textColor="@color/white"-->
|
||||||
<!-- app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
|
<!--app:layout_constraintTop_toTopOf="@+id/iv_message"-->
|
||||||
|
<!--app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/frame_layout"
|
android:id="@+id/frame_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -60,7 +61,8 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_map_type"
|
android:id="@+id/cb_map_type"
|
||||||
@ -72,7 +74,8 @@
|
|||||||
android:checked="false"
|
android:checked="false"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_foot_type"
|
android:id="@+id/cb_foot_type"
|
||||||
@ -83,7 +86,8 @@
|
|||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
app:layout_constraintRight_toRightOf="@id/cb_map_type"
|
app:layout_constraintRight_toRightOf="@id/cb_map_type"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cb_map_type" />
|
app:layout_constraintTop_toBottomOf="@id/cb_map_type"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_submit"
|
android:id="@+id/iv_submit"
|
||||||
@ -92,7 +96,8 @@
|
|||||||
android:src="@mipmap/submit"
|
android:src="@mipmap/submit"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del" />
|
app:layout_constraintTop_toTopOf="@id/iv_zoom_del"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_filter"
|
android:id="@+id/iv_filter"
|
||||||
@ -101,7 +106,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/filter"
|
android:src="@mipmap/filter"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_submit" />
|
app:layout_constraintTop_toBottomOf="@id/iv_submit"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_zoom_add"
|
android:id="@+id/iv_zoom_add"
|
||||||
@ -111,7 +117,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/zoom_add"
|
android:src="@mipmap/zoom_add"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cb_foot_type" />
|
app:layout_constraintTop_toBottomOf="@id/cb_foot_type"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_zoom_del"
|
android:id="@+id/iv_zoom_del"
|
||||||
@ -120,7 +127,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/zoom_del"
|
android:src="@mipmap/zoom_del"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add" />
|
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_refrish"
|
android:id="@+id/iv_refrish"
|
||||||
@ -129,7 +137,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/refresh"
|
android:src="@mipmap/refresh"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" />
|
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_location"
|
android:id="@+id/iv_location"
|
||||||
@ -138,7 +147,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/mine_location"
|
android:src="@mipmap/mine_location"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish" />
|
app:layout_constraintTop_toBottomOf="@id/iv_refrish"
|
||||||
|
/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|