Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree selection / detail panel updates #136

Merged
merged 3 commits into from Apr 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 17 additions & 5 deletions OpenTreeMap/src/OTM/Controllers/OTMMapViewController.m
Expand Up @@ -75,8 +75,10 @@ - (void)setupView {
[self.filterStatusView addTopBorder];
[self.filterStatusView addBottomBorder];

[self slideDetailDownAnimated:NO];
[self slideAddTreeHelpDownAnimated:NO];
// These 2 views are visible in the storyboard for design purposes, but
// should start offscreen when the parent view first appears
[self moveViewOffscreen:detailView];
[self moveViewOffscreen:addTreeHelpView];

[self hideFilterStatus];

Expand Down Expand Up @@ -112,6 +114,14 @@ - (void)setupView {

}

- (void)moveViewOffscreen:(UIView *)view {
[view setFrame:
CGRectMake(0,
self.view.bounds.size.height,
self.view.bounds.size.width,
view.frame.size.height)];
}

// Update the view with instance specific details
- (void)updateViewWithSharedEnvironment {

Expand Down Expand Up @@ -378,8 +388,10 @@ -(void)slideDownBottomDockedView:(UIView *)view animated:(BOOL)anim {
}

-(void)slideDetailDownAnimated:(BOOL)anim {
[self slideDownBottomDockedView:self.detailView animated:anim];
self.detailsVisible = NO;
if (detailsVisible) {
[self slideDownBottomDockedView:self.detailView animated:anim];
self.detailsVisible = NO;
}
}

-(void)slideAddTreeHelpDownAnimated:(BOOL)anim {
Expand Down Expand Up @@ -606,7 +618,7 @@ - (void)selectTreeNearCoordinate:(CLLocationCoordinate2D)coordinate
callback:^(NSArray* plots, NSError* error)
{
if ([plots count] == 0) { // No plots returned
[self slideDetailDownAnimated:YES];
[self clearSelectedTree];
} else {
NSDictionary* plot = [plots objectAtIndex:0];
[self selectPlot:plot];
Expand Down