|
@@ -42,6 +42,7 @@ typedef enum {
|
|
|
if (location == nil) {
|
|
if (location == nil) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ NSString *port = [location valueForKey:@"port"];
|
|
|
NSString* addr = [location valueForKey:@"addr"];
|
|
NSString* addr = [location valueForKey:@"addr"];
|
|
|
NSString* name = [location valueForKey:@"name"];
|
|
NSString* name = [location valueForKey:@"name"];
|
|
|
NSString *lonStr = [location valueForKey:@"lon"];
|
|
NSString *lonStr = [location valueForKey:@"lon"];
|
|
@@ -51,13 +52,21 @@ typedef enum {
|
|
|
double longitude = [lonStr doubleValue];
|
|
double longitude = [lonStr doubleValue];
|
|
|
double latitude = [latStr doubleValue];
|
|
double latitude = [latStr doubleValue];
|
|
|
|
|
|
|
|
|
|
+ if (port == nil) {
|
|
|
|
|
+ port = @"";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (addr == nil) {
|
|
|
|
|
+ addr = @"";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 创建大头针(标注)的数据模型(此处不创建视图,视图通过MKMapView的委托设置回调方法来生成的)
|
|
// 创建大头针(标注)的数据模型(此处不创建视图,视图通过MKMapView的委托设置回调方法来生成的)
|
|
|
AMShipAnnotation *ann = [[AMShipAnnotation alloc] init];
|
|
AMShipAnnotation *ann = [[AMShipAnnotation alloc] init];
|
|
|
CLLocationCoordinate2D c2d = CLLocationCoordinate2DMake(latitude, longitude);
|
|
CLLocationCoordinate2D c2d = CLLocationCoordinate2DMake(latitude, longitude);
|
|
|
// 指定大头针的经纬度坐标(位置)以及附加的信息
|
|
// 指定大头针的经纬度坐标(位置)以及附加的信息
|
|
|
ann.coordinate = c2d;
|
|
ann.coordinate = c2d;
|
|
|
ann.title = name;
|
|
ann.title = name;
|
|
|
- ann.subtitle = addr;
|
|
|
|
|
|
|
+ ann.subtitle = [NSString stringWithFormat:@"%@ %@",port,addr];
|
|
|
ann.priority = priority;
|
|
ann.priority = priority;
|
|
|
ann.imageName = imgName;
|
|
ann.imageName = imgName;
|
|
|
|
|
|
|
@@ -104,38 +113,45 @@ typedef enum {
|
|
|
|
|
|
|
|
// pol,pod,poe,por,origin,destination,current
|
|
// pol,pod,poe,por,origin,destination,current
|
|
|
if (locationInfo) {
|
|
if (locationInfo) {
|
|
|
- NSDictionary *pol = [locationInfo objectForKey:@"pol"];
|
|
|
|
|
|
|
+ NSMutableDictionary *pol = [[locationInfo objectForKey:@"pol"] mutableCopy];
|
|
|
if (self.showPol) {
|
|
if (self.showPol) {
|
|
|
- [self handleLoaction:pol Priority:AMShipAnnotationPriorityHigh ImageName:@"location_pol"];
|
|
|
|
|
|
|
+ [pol setObject:@"Port Of Load" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:pol Priority:AMShipAnnotationPriorityHigh ImageName:@"new_location_pol"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *pod = [locationInfo objectForKey:@"pod"];
|
|
|
|
|
|
|
+ NSMutableDictionary *pod = [[locationInfo objectForKey:@"pod"] mutableCopy];
|
|
|
if (self.showPod) {
|
|
if (self.showPod) {
|
|
|
- [self handleLoaction:pod Priority:AMShipAnnotationPriorityHigh ImageName:@"location_pod"];
|
|
|
|
|
|
|
+ [pod setObject:@"Port Of Discharge" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:pod Priority:AMShipAnnotationPriorityHigh ImageName:@"new_location_pod"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *poe = [locationInfo objectForKey:@"poe"];
|
|
|
|
|
|
|
+ NSMutableDictionary *poe = [[locationInfo objectForKey:@"poe"] mutableCopy];
|
|
|
if (self.showPoe) {
|
|
if (self.showPoe) {
|
|
|
- [self handleLoaction:poe Priority:AMShipAnnotationPriorityLow ImageName:@"location_poe"];
|
|
|
|
|
|
|
+ [poe setObject:@"Place Of Deliver" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:poe Priority:AMShipAnnotationPriorityLow ImageName:@"new_location_poe"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *por = [locationInfo objectForKey:@"por"];
|
|
|
|
|
|
|
+ NSMutableDictionary *por = [[locationInfo objectForKey:@"por"] mutableCopy];
|
|
|
if (self.showPor) {
|
|
if (self.showPor) {
|
|
|
- [self handleLoaction:por Priority:AMShipAnnotationPriorityLow ImageName:@"location_por"];
|
|
|
|
|
|
|
+ [por setObject:@"Place Of Receipt" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:por Priority:AMShipAnnotationPriorityLow ImageName:@"new_location_por"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *origin = [locationInfo objectForKey:@"origin"];
|
|
|
|
|
|
|
+ NSMutableDictionary *origin = [[locationInfo objectForKey:@"origin"] mutableCopy];
|
|
|
if (self.showOrigin) {
|
|
if (self.showOrigin) {
|
|
|
- [self handleLoaction:origin Priority:AMShipAnnotationPriorityLow ImageName:@"location_origin"];
|
|
|
|
|
|
|
+ [origin setObject:@"Origin" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:origin Priority:AMShipAnnotationPriorityLow ImageName:@"new_location_origin"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *destination = [locationInfo objectForKey:@"destination"];
|
|
|
|
|
|
|
+ NSMutableDictionary *destination = [[locationInfo objectForKey:@"destination"] mutableCopy];
|
|
|
if (self.showDestination) {
|
|
if (self.showDestination) {
|
|
|
- [self handleLoaction:destination Priority:AMShipAnnotationPriorityLow ImageName:@"location_destination"];
|
|
|
|
|
|
|
+ [destination setObject:@"Destination" forKey:@"port"];
|
|
|
|
|
+ [self handleLoaction:destination Priority:AMShipAnnotationPriorityLow ImageName:@"new_location_destination"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSDictionary *current = [locationInfo objectForKey:@"current"];
|
|
|
|
|
|
|
+ NSMutableDictionary *current = [[locationInfo objectForKey:@"current"] mutableCopy];
|
|
|
if (self.showCurrent) {
|
|
if (self.showCurrent) {
|
|
|
|
|
+ [current setObject:@"Current" forKey:@"port"];
|
|
|
[self handleLoaction:current Priority:AMShipAnnotationPriorityRequired ImageName:@"ic_marker"];
|
|
[self handleLoaction:current Priority:AMShipAnnotationPriorityRequired ImageName:@"ic_marker"];
|
|
|
}
|
|
}
|
|
|
[self moveToLocation:current];
|
|
[self moveToLocation:current];
|