修复了数据引起的marker
This commit is contained in:
@@ -7,8 +7,8 @@ import java.io.Serializable;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCarChat implements Serializable {
|
||||
|
||||
private MarkerLocation location;
|
||||
private String type;
|
||||
private MarkerLocation location;
|
||||
private MarkerUserInfo userInfo;
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
|
||||
@@ -7,15 +7,15 @@ import java.io.Serializable;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerDynamicData implements Serializable {
|
||||
|
||||
private Long id;
|
||||
private double id;
|
||||
private String name;
|
||||
private Long type;
|
||||
private double type;
|
||||
|
||||
public Long getId() {
|
||||
public double getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
public void setId(double id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MarkerDynamicData implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getType() {
|
||||
public double getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,18 +7,18 @@ import java.util.List;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerExploreWay implements Serializable {
|
||||
|
||||
private String addr;
|
||||
private boolean canLive;
|
||||
private String cityName;
|
||||
private float direction;
|
||||
private Long distance;
|
||||
private Long fileType;
|
||||
private Long generateTime;
|
||||
private List<MarkerExploreWayItem> items;
|
||||
private String type;
|
||||
private MarkerLocation location;
|
||||
private String type;//卡片类型,
|
||||
private String sn;
|
||||
private MarkerUserInfo userInfo;
|
||||
private MarkerLocation location;//位置信息
|
||||
private int direction;//方位角度
|
||||
private boolean canLive;//是否可直播(1为可直播,0不可直播)
|
||||
private int fileType;//是图片还是视频(1视频,0图片)
|
||||
private String addr;//北京市朝阳区三里屯街道108号
|
||||
private long generateTime;//时间戳
|
||||
private String cityName;//:"城市名称",
|
||||
private double distance;//距离
|
||||
private MarkerUserInfo userInfo;//用户信息
|
||||
private List<MarkerExploreWayItem> items;//视频地址和图片地址
|
||||
|
||||
public String getAddr() {
|
||||
return addr;
|
||||
@@ -48,23 +48,23 @@ public class MarkerExploreWay implements Serializable {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(float direction) {
|
||||
public void setDirection(int direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public Long getDistance() {
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(Long distance) {
|
||||
public void setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public Long getFileType() {
|
||||
public double getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(Long fileType) {
|
||||
public void setFileType(int fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.io.Serializable;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerHobbyDatum implements Serializable {
|
||||
|
||||
|
||||
private String content;
|
||||
|
||||
private int isCheck;
|
||||
|
||||
@@ -7,10 +7,34 @@ import java.io.Serializable;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerLocation implements Serializable {
|
||||
|
||||
private String address;
|
||||
private float angle;
|
||||
private Double lat;
|
||||
private Double lon;
|
||||
private double lat;//纬度
|
||||
private double lon;//经度
|
||||
private double angle;//车头角度,可以没有
|
||||
private String address;//具体的位置信息
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
@@ -20,37 +44,13 @@ public class MarkerLocation implements Serializable {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public float getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(float angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public Double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(Double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public Double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(Double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerLocation{" +
|
||||
"address='" + address + '\'' +
|
||||
", angle=" + angle +
|
||||
", lat=" + lat +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", angle=" + angle +
|
||||
", address='" + address + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@ import java.util.List;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerOnlineCar implements Serializable {
|
||||
|
||||
private List<MarkerActivitiesScope> activitiesScope;
|
||||
private MarkerCarInfo carInfo;
|
||||
private String compatibility;
|
||||
private MarkerDynamicData dynamicData;
|
||||
private List<MarkerHobbyDatum> hobbyData;
|
||||
private boolean isFocus;
|
||||
private MarkerLocation location;
|
||||
private String type;
|
||||
private MarkerUserInfo userInfo;
|
||||
private String type;//卡片类型
|
||||
private MarkerLocation location;//所在位置
|
||||
private Boolean isFocus;//isFocus":"0-未关注,1-关注
|
||||
private MarkerUserInfo userInfo;//用户数据
|
||||
private MarkerCarInfo carInfo;//车辆数据
|
||||
private MarkerDynamicData dynamicData;//动态数据
|
||||
private List<MarkerHobbyDatum> hobbyData;//爱好数据集合
|
||||
private List<MarkerActivitiesScope> activitiesScope;//活动范围数据集合
|
||||
private double compatibility;
|
||||
|
||||
public List<MarkerActivitiesScope> getActivitiesScope() {
|
||||
return activitiesScope;
|
||||
@@ -33,11 +33,11 @@ public class MarkerOnlineCar implements Serializable {
|
||||
this.carInfo = carInfo;
|
||||
}
|
||||
|
||||
public String getCompatibility() {
|
||||
public double getCompatibility() {
|
||||
return compatibility;
|
||||
}
|
||||
|
||||
public void setCompatibility(String compatibility) {
|
||||
public void setCompatibility(double compatibility) {
|
||||
this.compatibility = compatibility;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import java.io.Serializable;
|
||||
public class MarkerShareMusic implements Serializable {
|
||||
|
||||
private String bookInfo;
|
||||
private long id;
|
||||
private int likeNumber;
|
||||
private Double id;
|
||||
private Double likeNumber;
|
||||
private MarkerLocation location;
|
||||
private String mediaId;
|
||||
private String mediaImg;
|
||||
@@ -17,7 +17,7 @@ public class MarkerShareMusic implements Serializable {
|
||||
private String mediaSinger;
|
||||
private String mediaUrl;
|
||||
private String shareContentText;
|
||||
private int shareType;
|
||||
private Double shareType;
|
||||
private String type;
|
||||
private MarkerUserInfo userInfo;
|
||||
|
||||
@@ -29,30 +29,22 @@ public class MarkerShareMusic implements Serializable {
|
||||
this.bookInfo = bookInfo;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
public Double getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
public void setId(Double id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLikeNumber() {
|
||||
public Double getLikeNumber() {
|
||||
return likeNumber;
|
||||
}
|
||||
|
||||
public void setLikeNumber(int likeNumber) {
|
||||
public void setLikeNumber(Double likeNumber) {
|
||||
this.likeNumber = likeNumber;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
@@ -101,11 +93,11 @@ public class MarkerShareMusic implements Serializable {
|
||||
this.shareContentText = shareContentText;
|
||||
}
|
||||
|
||||
public int getShareType() {
|
||||
public Double getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
public void setShareType(int shareType) {
|
||||
public void setShareType(Double shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
@@ -125,6 +117,15 @@ public class MarkerShareMusic implements Serializable {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerShareMusic{" +
|
||||
|
||||
@@ -19,10 +19,8 @@ public class MarkerShowEntity {
|
||||
private String textContent;
|
||||
// Marker 类型
|
||||
private String markerType;
|
||||
|
||||
// 绑定 MarkerView 的数据
|
||||
private Object bindObj;
|
||||
|
||||
//Marker 经纬度位置信息
|
||||
private MarkerLocation markerLocation;
|
||||
|
||||
@@ -58,7 +56,6 @@ public class MarkerShowEntity {
|
||||
this.markerType = markerType;
|
||||
}
|
||||
|
||||
|
||||
public Object getBindObj() {
|
||||
return bindObj;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ import java.util.Calendar;
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerUserInfo implements Serializable {
|
||||
|
||||
private int age;
|
||||
private String gender;
|
||||
private String sn;
|
||||
private String userHead;
|
||||
private Long userId;
|
||||
private String userName;
|
||||
private long userId;
|
||||
private String userName;//用户昵称
|
||||
private String userHead;//用户头像
|
||||
private String gender;//gender": "男|女|无(也可以0|1|2根据实际库存返回即可)
|
||||
private int age;// 年龄段,可以为空,与车聊聊一致
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
@@ -25,7 +25,7 @@ public class MarkerUserInfo implements Serializable {
|
||||
int year = cal.get(Calendar.YEAR);
|
||||
|
||||
//2020-30=1990
|
||||
int ageDiffer = year - age;
|
||||
double ageDiffer = year - age;
|
||||
String ageStr = "" + ageDiffer;
|
||||
char[] ageChars = ageStr.toCharArray();
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ public class MarkerServiceHandler {
|
||||
List<MarkerCarChat> carChat = markerCardResult.getCarChat();
|
||||
List<MarkerOnlineCar> onlineCar = markerCardResult.getOnlineCar();
|
||||
List<MarkerExploreWay> exploreWay = markerCardResult.getExploreWay();
|
||||
List<MarkerShareMusic> shareMusic = markerCardResult.getShareMusic();
|
||||
// List<MarkerShareMusic> shareMusic = markerCardResult.getShareMusic();
|
||||
|
||||
if (carChat != null) {
|
||||
for (MarkerCarChat markerCarChat : carChat) {
|
||||
@@ -209,27 +209,26 @@ public class MarkerServiceHandler {
|
||||
markerShowEntity.setMarkerLocation(markerLocation);
|
||||
markerShowEntity.setMarkerType(markerExploreWay.getType());
|
||||
markerShowEntity.setTextContent(markerExploreWay.getAddr());
|
||||
markerShowEntity.setIconUrl(markerExploreWay.getUserInfo().getUserHead());
|
||||
|
||||
drawMapMarker(markerShowEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shareMusic != null) {
|
||||
for (MarkerShareMusic markerShareMusic : shareMusic) {
|
||||
MarkerLocation markerLocation = markerShareMusic.getLocation();
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj(markerShareMusic);
|
||||
markerShowEntity.setMarkerLocation(markerLocation);
|
||||
markerShowEntity.setMarkerType(markerShareMusic.getType());
|
||||
markerShowEntity.setTextContent(markerShareMusic.getMediaName());
|
||||
markerShowEntity.setIconUrl(markerShareMusic.getMediaImg());
|
||||
|
||||
drawMapMarker(markerShowEntity);
|
||||
}
|
||||
}
|
||||
// if (shareMusic != null) {
|
||||
// for (MarkerShareMusic markerShareMusic : shareMusic) {
|
||||
// MarkerLocation markerLocation = markerShareMusic.getLocation();
|
||||
//
|
||||
// MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
// markerShowEntity.setBindObj(markerShareMusic);
|
||||
// markerShowEntity.setMarkerLocation(markerLocation);
|
||||
// markerShowEntity.setMarkerType(markerShareMusic.getType());
|
||||
// markerShowEntity.setTextContent(markerShareMusic.getMediaName());
|
||||
// markerShowEntity.setIconUrl(markerShareMusic.getMediaImg());
|
||||
//
|
||||
// drawMapMarker(markerShowEntity);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
getMapUIController().changeZoom(8);
|
||||
@@ -240,19 +239,24 @@ public class MarkerServiceHandler {
|
||||
*/
|
||||
public static IMogoMarker drawMapMarker(MarkerShowEntity markerShowEntity) {
|
||||
Logger.e(TAG, "绘制Marker====markerTag:" + markerShowEntity);
|
||||
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerShowEntity.getMarkerType())
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
if (markerShowEntity.getMarkerLocation() != null) {
|
||||
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
|
||||
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(markerShowEntity.getMarkerType())
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
options.icon(markerView);
|
||||
|
||||
return marker;
|
||||
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
marker.setOnMarkerClickListener(mogoMarkerClickListener);
|
||||
marker.setObject(markerShowEntity);
|
||||
return marker;
|
||||
} else {
|
||||
Logger.e(TAG, "Location 必须进行初始化!!!!!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
break;
|
||||
}
|
||||
|
||||
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
|
||||
tvMarkerContent.setText(markerShowEntity.getTextContent());
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
break;
|
||||
}
|
||||
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
|
||||
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
|
||||
|
||||
loadImageWithMarker(markerShowEntity);
|
||||
|
||||
|
||||
@@ -375,10 +375,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
* @param exploreWay
|
||||
*/
|
||||
private void handleData(MarkerExploreWay exploreWay) {
|
||||
if (exploreWay != null && exploreWay.getFileType() != null) {
|
||||
if (exploreWay.getFileType().equals("0")) { //图片
|
||||
if (exploreWay != null ) {
|
||||
if (exploreWay.getFileType()==0) { //图片
|
||||
refreshPhotoData(exploreWay);
|
||||
} else if (exploreWay.getFileType().equals("1")) { //视频
|
||||
} else if (exploreWay.getFileType()==1) { //视频
|
||||
refreshVideoData(exploreWay);
|
||||
}
|
||||
} else {
|
||||
@@ -483,10 +483,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
//展示第一个数据
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
|
||||
if (markerExploreWay != null && markerExploreWay.getFileType() != null) {
|
||||
if (markerExploreWay.getFileType().equals("0")) { //图片
|
||||
if (markerExploreWay != null) {
|
||||
if (markerExploreWay.getFileType()==0) { //图片
|
||||
refreshPhotoData(markerExploreWay);
|
||||
} else if (markerExploreWay.getFileType().equals("1")) { //视频
|
||||
} else if (markerExploreWay.getFileType()==1) { //视频
|
||||
refreshVideoData(markerExploreWay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.text.DecimalFormat;
|
||||
public class Utils {
|
||||
|
||||
//处理距离,大于1000时,四舍五入保留一位小数
|
||||
public static String handleDistance(long distance) {
|
||||
public static String handleDistance(double distance) {
|
||||
if (distance < 1000) {
|
||||
return distance + "M";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user