Permalink
Browse files

photo on yelp map 1/4 size and dynamically resizes; general housekeeper

  • Loading branch information...
1 parent 30571c4 commit f24a434b8866798b6d25f0d51f4be5e01e9b68f1 gBit committed Mar 28, 2013
View
@@ -29,5 +29,4 @@
- (void)removePhotoObject:(Photo *)value;
- (void)addPhoto:(NSSet *)values;
- (void)removePhoto:(NSSet *)values;
-
@end
@@ -136,7 +136,6 @@
83B0D00916FA1A8900C9D8F8 /* HistoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HistoryViewController.m; sourceTree = "<group>"; };
83BB6B6A16FA0A31003A4506 /* circleMask6464.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = circleMask6464.png; sourceTree = "<group>"; };
83BB6B6D16FA0A64003A4506 /* circleMask6464@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "circleMask6464@2x.png"; sourceTree = "<group>"; };
- 83BB6B6F16FA0B1A003A4506 /* RossScratchpad.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RossScratchpad.h; sourceTree = "<group>"; };
83D7203616FF964A0012A0B0 /* loadingPage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loadingPage.png; sourceTree = "<group>"; };
83D97AF316FB859C00B525E2 /* circleMask@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "circleMask@2x.png"; sourceTree = "<group>"; };
83D97AF516FB872000B525E2 /* circleMaskShine@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "circleMaskShine@2x.png"; path = "MappingMashupApp/circleMaskShine@2x.png"; sourceTree = "<group>"; };
@@ -169,7 +168,6 @@
8F372B5716F2672100302B80 /* ResultsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResultsManager.m; sourceTree = "<group>"; };
8F372B5916F2678A00302B80 /* Annotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Annotation.h; sourceTree = "<group>"; };
8F372B5A16F2678A00302B80 /* Annotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Annotation.m; sourceTree = "<group>"; };
- B40B477116F68CB4006BD4CE /* copyOfVenue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = copyOfVenue.h; sourceTree = "<group>"; };
B40B477416F68FC1006BD4CE /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
B425500716F6B158005CCC9E /* Venue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Venue.h; path = ../Venue.h; sourceTree = "<group>"; };
B425500816F6B158005CCC9E /* Venue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Venue.m; path = ../Venue.m; sourceTree = "<group>"; };
@@ -207,13 +205,6 @@
name = "Tab View Items";
sourceTree = "<group>";
};
- 83D97AF916FB970F00B525E2 /* CustomCalloutClasses */ = {
- isa = PBXGroup;
- children = (
- );
- name = CustomCalloutClasses;
- sourceTree = "<group>";
- };
8F372AF716F244C800302B80 = {
isa = PBXGroup;
children = (
@@ -249,10 +240,8 @@
8F372B0916F244C800302B80 /* MappingMashupApp */ = {
isa = PBXGroup;
children = (
- 83D97AF916FB970F00B525E2 /* CustomCalloutClasses */,
830729D216F766D6000F0037 /* Model.xcdatamodeld */,
8F372B1B16F244C800302B80 /* MainStoryboard.storyboard */,
- B40B477616F69055006BD4CE /* Backups */,
8F372B5C16F2698B00302B80 /* Classes */,
8F372B4F16F2661300302B80 /* Delegates */,
8F372B5D16F269A700302B80 /* Managers */,
@@ -326,9 +315,9 @@
8F372B5E16F269B100302B80 /* View Controllers */ = {
isa = PBXGroup;
children = (
+ 83B0D00716FA1A2000C9D8F8 /* Tab View Items */,
839BFAE01703BF550061F5BC /* AboutUsViewController.h */,
839BFAE11703BF560061F5BC /* AboutUsViewController.m */,
- 83B0D00716FA1A2000C9D8F8 /* Tab View Items */,
83FE37E016F76CD6000C9935 /* FlickrMapViewController.h */,
83FE37E116F76CD6000C9935 /* FlickrMapViewController.m */,
8F372B1E16F244C800302B80 /* YelpMapViewController.h */,
@@ -372,15 +361,6 @@
path = ..;
sourceTree = "<group>";
};
- B40B477616F69055006BD4CE /* Backups */ = {
- isa = PBXGroup;
- children = (
- 83BB6B6F16FA0B1A003A4506 /* RossScratchpad.h */,
- B40B477116F68CB4006BD4CE /* copyOfVenue.h */,
- );
- name = Backups;
- sourceTree = "<group>";
- };
B425501016F6B1D1005CCC9E /* Managed */ = {
isa = PBXGroup;
children = (
@@ -12,6 +12,7 @@
#import "LocationManager.h"
#import <MapKit/MapKit.h>
#import "Venue.h"
+#import "Annotation.h"
@protocol APIManagerDelegate <NSObject>
@@ -34,5 +35,7 @@
- (void)searchYelpThenFlickrForDelegates;
- (void)searchYelpForDelegates;
- (NSMutableArray*)searchFlickr;
+- (void)retrieveFullSizedImageForSelectedAnnotation:(Annotation*)annotation;
+
@end
@@ -206,4 +206,6 @@ - (NSMutableArray *)createPhotosArray:(NSArray *)jsonFlickrArray
return flickrPhotosArray;
}
+
+
@end
@@ -10,7 +10,6 @@
@interface AboutUsViewController ()
{
-
__weak IBOutlet UIButton *rossPeanut;
__weak IBOutlet UIButton *paulPeanut;
__weak IBOutlet UIButton *emilyPeanut;
@@ -58,7 +57,6 @@ - (IBAction)emilyPeanutTapped:(id)sender {
[UIView animateWithDuration:0.5 animations:^(void){ davidPeanut.center = CGPointMake(davidPeanut.center.x, 42);rossPeanut.center = CGPointMake(rossPeanut.center.x, 45); emilyPeanut.center = CGPointMake(emilyPeanut.center.x, 85); paulPeanut.center = CGPointMake(paulPeanut.center.x, 45);} completion:^(BOOL finished) {
aboutTextField.text = @"Emily Oess\n\n-|gBit@eOS|~| |:)\n-$ zonnet\n\nChicago-Brown Line Station\nYou are at the end of an el platform in an urban environment west of a big blue lake. A turnstile leads to a set of stairs. In the distance, you can see that the stairs will eventually fork off. The buildings here are very tall concrete buildings, and they are spaced (relatively) equidistant from each other. There is a girl here.\n> look girl\nThe girl appears pretty normal from the outside, but if superhero movies have taught you anything it's that masked avengers frequently look super ordinary in broad daylight because that's obviously how you conceal your identity. No, sir. Because while this girl may enjoys long walks on the beach, she also digs refactoring code. And then you realize you're talking to yourself.\n> look\nYou are still on the el platform. Looking at the clock on your iPhone, you notice another train has arrived and you have no idea exactly how long you've been standing here wrapped up in meta-cognition. Better get going or you're going to be late, yo.\n> down\nN Franklin/W Superior Intersection\nYou are at an intersection of two streets, one running north/south, and one running east/west. You can also go back up the stairs.\n> south\nN Franklin/W Huron Intersection\nYou are on the continuation of a city street. There are more buildings on both sides of you. The roads continue north/south and east/west.\n> s\nN Franklin/W Erie Intersection\nYou are STILL on the continuation of a city street. In the distance you can see that it will eventually hit a river. You notice The Mobile Makers building to the southeast.\n> se\nBuilding front\nThere is a building in front of you to the south, and the road leads back to the east/west.\n> in\nYou don't have a key that can open this door. Luckily, a group of people walk up and go in.\n> tailgate\nLobby\nYou are in the building lobby. There are stairs and an elevator here. Your spidey sense kicks in and you realize there is another nerd in close proximity.\n> talk to nerd\nYou attempt to talk to the nerd, but cannot hear his response because you've been rockin' out to some mad beats.\n> take out earbuds\nYou take out your headphones and start a conversation that makes everyone around take a step back. They obviously fear catching the nerditude.\n> turn up volume\nDone. Bring the noise.";
}];
-
}
- (IBAction)paulPeanutTapped:(id)sender {
@@ -17,27 +17,18 @@
@property (strong, nonatomic) NSString *urlString;
@property (strong, nonatomic) NSString *flickrThumbnailString;
-
-
-
-
//these are properties we need on a pinAnnotation to make an entity. We may be duplicating info above. Added by David 3/21/13
- @property (nonatomic, retain) NSNumber * latitude;
- @property (nonatomic, retain) NSNumber * longitude;
- @property (nonatomic, retain) NSString * name;
- @property (nonatomic, retain) NSString * phone;
- @property (nonatomic, retain) NSNumber * isBookmarked;
- @property (nonatomic, retain) NSDate * viewDate;
- @property (nonatomic, retain) NSString * yelpURLString;
- @property (nonatomic, retain) NSSet *photo;
-
-
-
-//- initWithPosition:(CLLocationCoordinate2D)coordinates;
+@property (nonatomic, retain) NSNumber * latitude;
+@property (nonatomic, retain) NSNumber * longitude;
+@property (nonatomic, retain) NSString * name;
+@property (nonatomic, retain) NSString * phone;
+@property (nonatomic, retain) NSNumber * isBookmarked;
+@property (nonatomic, retain) NSDate * viewDate;
+@property (nonatomic, retain) NSString * yelpURLString;
+@property (nonatomic, retain) NSSet *photo;
- (id)initWithCoordinate:(CLLocationCoordinate2D)coord
title:(NSString*)titleString
subtitle:(NSString*)subtitleString
- urlString:(NSString*)urlString;
-
+ urlString:(NSString*)urlString;
@end
@@ -11,22 +11,10 @@
@implementation Annotation
@synthesize coordinate,title,subtitle, urlString, latitude, longitude, name, phone, isBookmarked, viewDate, yelpURLString, photo;
-
-
-
-
-//- initWithPosition:(CLLocationCoordinate2D *)coordinates
-//{
-// if (self = [super init]) {
-// self.coordinate = *(coordinates);
-// }
-// return self;
-//}
-
- (id)initWithCoordinate:(CLLocationCoordinate2D)coord
title:(NSString*)titleString
subtitle:(NSString*)subtitleString
- urlString:(NSString *)urlString
+ urlString:(NSString *)urlString
{
if (self = [super init])
{
@@ -35,8 +23,6 @@ - (id)initWithCoordinate:(CLLocationCoordinate2D)coord
self.subtitle = subtitleString;
self.urlString = urlString;
}
-
return self;
}
-
@end
@@ -19,10 +19,5 @@
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
-//Property for current location coordinate
@property (strong, nonatomic) LocationManager *locationManager;
-
-
-
-
@end
@@ -16,15 +16,7 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
-
-
-
-
-
-
-
-
+{
// what's file manager?
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *documentsDirectory = [[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
@@ -21,7 +21,7 @@
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
--(void)didReceiveYelpData: (NSMutableArray*)venuesArray;
+- (void)didReceiveYelpData: (NSMutableArray*)venuesArray;
//NOT a pre-defined method
-(void) startLocationUpdates;
@@ -132,6 +132,12 @@ -(void)foundLocation:(CLLocation*)loc
[locationManager stopUpdatingLocation];
}
+-(void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
+{
+ NSLog(@"User gave permission to use location");
+ [self viewDidLoad];
+}
+
-(void)didReceiveFlickrData:(NSMutableArray*)photosArray
{
@@ -141,24 +147,21 @@ -(void)didReceiveFlickrData:(NSMutableArray*)photosArray
-(void)didReceiveYelpData: (NSMutableArray*)venuesArray
{
-
//[self addPinsToMap:venuesArray];
}
- (void)addPinsToMap:(NSMutableArray*)venuesArray;
{
-
// make region our area
MKCoordinateSpan span =
{
-// .latitudeDelta = 0.01810686f,
-// .longitudeDelta = 0.01810686f
- .latitudeDelta = 0.00950686f,
- .longitudeDelta = 0.00950686f
+ .latitudeDelta = 0.01810686f,
+ .longitudeDelta = 0.01810686f
+// .latitudeDelta = 0.00950686f,
+// .longitudeDelta = 0.00950686f
// .latitudeDelta = 0.00550686f,
- // .longitudeDelta = 0.00550686f
-
+// .longitudeDelta = 0.00550686f
};
MKCoordinateRegion region = {missLocationManager.location.coordinate, span};
@@ -318,32 +321,25 @@ - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)o
//
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
-
- if([view.annotation isKindOfClass: [MKUserLocation class]])
- {
+ if ([view.annotation isKindOfClass: [MKUserLocation class]])
return;
- }
- if (didSelectThumbnail == NO)
+
+ selectedAnnotation = view.annotation;
+ [self retrieveFullSizedImageForSelectedAnnotation:selectedAnnotation];
+
+ if (!didSelectThumbnail)
{
- didSelectThumbnail = YES;
[view squishImage];
-
- selectedAnnotation = view.annotation;
- [self displayFullSizedImageForSelectedAnnotation:selectedAnnotation];
// adjust entry point for animation (as determined by image size)
photoViewerUIImageView.superview.center = CGPointMake(photoViewerUIImageView.superview.center.x, -photoViewerUIImageView.superview.frame.size.height);
-
[enlargedPhotoViewOutlet lowerImageView];
- }
- else
- {
- selectedAnnotation = view.annotation;
- [self displayFullSizedImageForSelectedAnnotation:selectedAnnotation];
- }
+
+ didSelectThumbnail = YES;
+ }
}
-- (void)displayFullSizedImageForSelectedAnnotation:(Annotation*)annotation
+- (void)retrieveFullSizedImageForSelectedAnnotation:(Annotation*)annotation
{
// grab the medium sized version of the annotion image from flickr
NSString *photoFullSizeURLString = [annotation.flickrThumbnailString stringByReplacingOccurrencesOfString:@"s.jpg" withString:@"n.jpg"];
@@ -446,7 +442,7 @@ -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
ymvc.originPhotoLongitude = longitudeToPass;
ymvc.originPhotoLatitude = latitudeToPass;
ymvc.originPhotoTitle = photoTitleToPass;
- ymvc.originPhotoThumbnailString = photoThumbnailStringToPass;
+ ymvc.originPhotoThumbnailURL = photoThumbnailStringToPass;
}
}
@@ -14,5 +14,4 @@
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
-
@end
Oops, something went wrong.

0 comments on commit f24a434

Please sign in to comment.