|
|
@@ -174,6 +174,43 @@
|
|
|
|
|
|
UIBarButtonItem *previewMenuBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_menu"] style:UIBarButtonItemStylePlain target:self action:@selector(quickLookMenuClick:)];
|
|
|
self.quickLook.navigationItem.rightBarButtonItem = previewMenuBtn;
|
|
|
+
|
|
|
+ [self configureMap];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)configureMap {
|
|
|
+
|
|
|
+ if (!self.showMap) {
|
|
|
+
|
|
|
+ NSArray *constraints = [[self.view constraints] mutableCopy];
|
|
|
+ // 删除Table与Map相关约束
|
|
|
+ for (NSLayoutConstraint *constaint in constraints) {
|
|
|
+ if ([constaint.identifier isEqualToString:@"top_constraint"]) {
|
|
|
+ [self.view removeConstraint:constaint];
|
|
|
+ } else if ([constaint.identifier isEqualToString:@"ratio_constraint"]) {
|
|
|
+ [self.view removeConstraint:constaint];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 移除地图
|
|
|
+ [self.shipMap removeFromSuperview];
|
|
|
+ self.shipMap = nil;
|
|
|
+
|
|
|
+ // 设置新约束
|
|
|
+ NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:self.table
|
|
|
+ attribute:NSLayoutAttributeTop
|
|
|
+ relatedBy:NSLayoutRelationEqual
|
|
|
+ toItem:self.topLayoutGuide
|
|
|
+ attribute:NSLayoutAttributeBottom
|
|
|
+ multiplier:1.0
|
|
|
+ constant:0];
|
|
|
+ [self.view addConstraint:top];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [self.view layoutIfNeeded];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)saveDocumentClick:(id)sender {
|
|
|
@@ -1147,6 +1184,20 @@
|
|
|
return nil;
|
|
|
}
|
|
|
|
|
|
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+
|
|
|
+ NSMutableDictionary* segment = [self.content.segments[indexPath.section] mutableCopy];
|
|
|
+ NSString* type =[segment valueForKey:@"_type"];
|
|
|
+
|
|
|
+ if([type isEqualToString:@"tracking"]) {
|
|
|
+ NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
|
|
|
+ NSDictionary *location = [item objectForKey:@"location"];
|
|
|
+ [self.shipMap showShipAnnotaion:location];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Quick Look
|
|
|
|
|
|
- (MyQLPreviewController *)quickLook {
|