|
@@ -135,9 +135,9 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static int AnnotationDisplayPriorityRequired = 0;
|
|
|
|
|
|
|
+ private static int AnnotationDisplayPriorityRequired = 2;
|
|
|
private static int AnnotationDisplayPriorityHigh= 1;
|
|
private static int AnnotationDisplayPriorityHigh= 1;
|
|
|
- private static int AnnotationDisplayPriorityLow = 2;
|
|
|
|
|
|
|
+ private static int AnnotationDisplayPriorityLow = 0;
|
|
|
|
|
|
|
|
private JSONObject mAnnotation;
|
|
private JSONObject mAnnotation;
|
|
|
|
|
|
|
@@ -159,8 +159,9 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
}
|
|
}
|
|
|
mAnnotation = null;
|
|
mAnnotation = null;
|
|
|
|
|
|
|
|
|
|
+ JSONObject pol = annotation.optJSONObject("pol");
|
|
|
if (showPol()) {
|
|
if (showPol()) {
|
|
|
- JSONObject pol = annotation.optJSONObject("pol");
|
|
|
|
|
|
|
+
|
|
|
if (pol != null) {
|
|
if (pol != null) {
|
|
|
try {
|
|
try {
|
|
|
pol.put("port","Port Of Load");
|
|
pol.put("port","Port Of Load");
|
|
@@ -169,32 +170,37 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
}
|
|
}
|
|
|
handleLocation(pol,AnnotationDisplayPriorityHigh,R.drawable.new_location_pol);
|
|
handleLocation(pol,AnnotationDisplayPriorityHigh,R.drawable.new_location_pol);
|
|
|
}
|
|
}
|
|
|
-// moveToLocation(pol);
|
|
|
|
|
}
|
|
}
|
|
|
- if (showPoe()) {
|
|
|
|
|
- JSONObject poe = annotation.optJSONObject("poe");
|
|
|
|
|
- if (poe != null) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject pod = annotation.optJSONObject("pod");
|
|
|
|
|
+ if (showPod()) {
|
|
|
|
|
+
|
|
|
|
|
+ if (pod != null) {
|
|
|
try {
|
|
try {
|
|
|
- poe.put("port","Place Of Deliver");
|
|
|
|
|
|
|
+ pod.put("port","Port Of Discharge");
|
|
|
} catch (JSONException e) {
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
- handleLocation(poe,AnnotationDisplayPriorityLow,R.drawable.new_location_poe);
|
|
|
|
|
|
|
+ handleLocation(pod,AnnotationDisplayPriorityHigh,R.drawable.new_location_pod);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (showPod()) {
|
|
|
|
|
- JSONObject pod = annotation.optJSONObject("pod");
|
|
|
|
|
- if (pod != null) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject poe = annotation.optJSONObject("poe");
|
|
|
|
|
+ if (showPoe()) {
|
|
|
|
|
+
|
|
|
|
|
+ if (poe != null) {
|
|
|
try {
|
|
try {
|
|
|
- pod.put("port","Port Of Discharge");
|
|
|
|
|
|
|
+ poe.put("port","Place Of Deliver");
|
|
|
} catch (JSONException e) {
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
- handleLocation(pod,AnnotationDisplayPriorityHigh,R.drawable.new_location_pod);
|
|
|
|
|
|
|
+ handleLocation(poe,AnnotationDisplayPriorityLow,R.drawable.new_location_poe);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject por = annotation.optJSONObject("por");
|
|
|
if (showPor()) {
|
|
if (showPor()) {
|
|
|
- JSONObject por = annotation.optJSONObject("por");
|
|
|
|
|
|
|
+
|
|
|
if (por != null) {
|
|
if (por != null) {
|
|
|
try {
|
|
try {
|
|
|
por.put("port","Place Of Receipt");
|
|
por.put("port","Place Of Receipt");
|
|
@@ -204,8 +210,10 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
handleLocation(por,AnnotationDisplayPriorityLow,R.drawable.new_location_por);
|
|
handleLocation(por,AnnotationDisplayPriorityLow,R.drawable.new_location_por);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject origin = annotation.optJSONObject("origin");
|
|
|
if (showOrigin()) {
|
|
if (showOrigin()) {
|
|
|
- JSONObject origin = annotation.optJSONObject("origin");
|
|
|
|
|
|
|
+
|
|
|
if (origin != null) {
|
|
if (origin != null) {
|
|
|
try {
|
|
try {
|
|
|
origin.put("port","Origin");
|
|
origin.put("port","Origin");
|
|
@@ -215,8 +223,10 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
handleLocation(origin,AnnotationDisplayPriorityLow,R.drawable.new_location_origin);
|
|
handleLocation(origin,AnnotationDisplayPriorityLow,R.drawable.new_location_origin);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject destination = annotation.optJSONObject("destination");
|
|
|
if (showDestination()) {
|
|
if (showDestination()) {
|
|
|
- JSONObject destination = annotation.optJSONObject("destination");
|
|
|
|
|
|
|
+
|
|
|
if (destination != null) {
|
|
if (destination != null) {
|
|
|
try {
|
|
try {
|
|
|
destination.put("port","Destination");
|
|
destination.put("port","Destination");
|
|
@@ -238,7 +248,15 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
handleLocation(current,AnnotationDisplayPriorityRequired,R.drawable.ic_marker);
|
|
handleLocation(current,AnnotationDisplayPriorityRequired,R.drawable.ic_marker);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- moveToLocation(current);
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (current != null && showCurrent()) {
|
|
|
|
|
+ moveToLocation(current);
|
|
|
|
|
+ } else if (pol != null && showPol()) {
|
|
|
|
|
+ moveToLocation(pol);
|
|
|
|
|
+ } else if (pod != null && showPod()) {
|
|
|
|
|
+ moveToLocation(pod);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -307,11 +325,15 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
addr = "";
|
|
addr = "";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- mGoogleMap.addMarker(new com.google.android.gms.maps.model.MarkerOptions()
|
|
|
|
|
- .icon(com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(imageId))
|
|
|
|
|
|
|
+ com.google.android.gms.maps.model.MarkerOptions options = new com.google.android.gms.maps.model.MarkerOptions();
|
|
|
|
|
+ options.icon(com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource(imageId))
|
|
|
.position(new com.google.android.gms.maps.model.LatLng(Double.parseDouble(latStr), Double.parseDouble(lonStr)))
|
|
.position(new com.google.android.gms.maps.model.LatLng(Double.parseDouble(latStr), Double.parseDouble(lonStr)))
|
|
|
.title(name)
|
|
.title(name)
|
|
|
- .snippet(port + " " + addr));
|
|
|
|
|
|
|
+ .snippet(port + " " + addr);
|
|
|
|
|
+ options.zIndex(priority);
|
|
|
|
|
+
|
|
|
|
|
+ mGoogleMap.addMarker(options);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
return;
|
|
return;
|
|
@@ -343,6 +365,8 @@ public class ShipMap extends RelativeLayout implements GoogleMap.OnMarkerClickLi
|
|
|
extrainfo.putString("detail",port + " " + addr);
|
|
extrainfo.putString("detail",port + " " + addr);
|
|
|
|
|
|
|
|
MarkerOptions markeroption = new MarkerOptions().position(llA).icon(icon).zIndex(9).title(name).extraInfo(extrainfo).draggable(true);
|
|
MarkerOptions markeroption = new MarkerOptions().position(llA).icon(icon).zIndex(9).title(name).extraInfo(extrainfo).draggable(true);
|
|
|
|
|
+ markeroption.zIndex(priority);
|
|
|
|
|
+
|
|
|
mBaiduMap.getMap().addOverlay(markeroption);
|
|
mBaiduMap.getMap().addOverlay(markeroption);
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|