Permalink
Browse files

photo drop fully funtional

  • Loading branch information...
1 parent bce6d23 commit a62b6d3b08af2514c6b3878995f1cbd1b387145c @cozmoboy cozmoboy committed Mar 27, 2013
@@ -40,6 +40,7 @@ @interface FlickrMapViewController ()
__weak IBOutlet UIImageView *photoViewerUIImageView;
BOOL didSelectThumbnail;
}
+- (IBAction)fullSizedPhotoTapped:(id)sender;
- (IBAction)closePhotoButtonPressed:(id)sender;
@@ -98,7 +99,7 @@ - (void)viewDidLoad
};
NSLog(@"%f %f", mobileMakers.latitude, mobileMakers.longitude);
- MKCircle *overlay = [MKCircle circleWithCenterCoordinate:mobileMakers radius:100000];
+ MKCircle *overlay = [MKCircle circleWithCenterCoordinate:mobileMakers radius:1000000000];
overlay.title = @"Current region";
@@ -217,8 +218,11 @@ - (void)addPinsToMap:(NSMutableArray*)venuesArray;
{
// .latitudeDelta = 0.01810686f,
// .longitudeDelta = 0.01810686f
- .latitudeDelta = 0.00950686f,
- .longitudeDelta = 0.00950686f
+// .latitudeDelta = 0.00950686f,
+// .longitudeDelta = 0.00950686f
+ .latitudeDelta = 0.00550686f,
+ .longitudeDelta = 0.00550686f
+
};
MKCoordinateRegion region = {missLocationManager.location.coordinate, span};
@@ -404,7 +408,7 @@ - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)o
{
MKCircleView* aView = [[MKCircleView alloc] initWithCircle:(MKCircle *)overlay];
- aView.fillColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
+ aView.fillColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
aView.strokeColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
aView.lineWidth = 1;
@@ -427,49 +431,7 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
didSelectThumbnail = YES;
[view squishImage];
-
-
- //..............NEW 3/27.. TO BE PLAYED WITH TO SCALE PHOTO WHEN SELECTED..
- //FROM CORE GRAPHIC EXERCIZE............
-
-// CGSize sizeOfNewImage =  CGSizeMake(sizeScaled, sizeScaled);
-//
-////This gets a new context of size sizeOfNewImage
-// UIGraphicsBeginImageContext(sizeOfNewImage);
-//
-// //
-// //THE BEGINNING OF DOING STUFF ON A NEW DESK (context)
-// //
-//
-////Grab whatever is on the desk (context)
-// CGContextRef context = UIGraphicsGetCurrentContext();
-////This changes the interpolation level. If you are using a small image, use low interpolation
-//CGContextSetInterpolationQuality(context, kCGInterpolationLow);
-//CGContextSetInterpolationQuality(context, kCGInterpolationMedium);
-//CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
-//
-////draw the jake picture on our new desk (context)
-////(This was originally the image size - 256x256 - we changed it)
-//[jake drawInRect:CGRectMake(0, 0, sizeOfNewImage.width, sizeOfNewImage.height)];
-//
-////pick up image from the desk (context)
-//UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
-//
-//UIGraphicsEndImageContext();
-//
-////THE END OF DOING STUFF
-//
-//myViewOfJake.image = scaledImage;
-////resizing the frame of the view of the image to match
-//myViewOfJake.frame = CGRectMake(0, 0, sizeOfNewImage.width, sizeOfNewImage.height);
-////recenter the view after changing the frame
-//myViewOfJake.center = self.view.center;
-
- //NEW END 3/27 ..............TO BE PLAYED WITH TO SCALE PHOTO WHEN SELECTED
-
-
-
- [photoViewerUIImageView raiseImageView];
+
selectedAnnotation = view.annotation;
//Code to make the selected image show up in the photo viewer
@@ -479,9 +441,6 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
NSData *photoData = [NSData dataWithContentsOfURL:photoFullSizeURL];
UIImage *photoFullSize = [UIImage imageWithData:photoData];
photoViewerUIImageView.image = photoFullSize;
- //photoViewerUIImageView.image = [UIImage imageNamed:@"xmark.png"];
- [enlargedPhotoViewOutlet addSubview:photoViewerUIImageView];
- //enlargedPhotoViewOutlet.subvie
[enlargedPhotoViewOutlet lowerImageView];
@@ -507,6 +466,16 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
}
+- (IBAction)fullSizedPhotoTapped:(id)sender
+{
+ latitudeToPass = selectedAnnotation.coordinate.latitude;
+ longitudeToPass = selectedAnnotation.coordinate.longitude;
+ photoTitleToPass = selectedAnnotation.title;
+ photoThumbnailStringToPass = selectedAnnotation.urlString;
+
+ [self performSegueWithIdentifier:@"toYelpMapView" sender:nil];
+}
+
- (IBAction)closePhotoButtonPressed:(id)sender
{
if (didSelectThumbnail == YES) {
@@ -523,10 +492,9 @@ - (IBAction)closePhotoButtonPressed:(id)sender
//
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
- NSLog(@"This is the method we want!");
- // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"m.yelp.com"]];
- NSLog(@"%@", view.annotation);
- //These instance variables will be passed in the segue
+
+
+ //These instance variables will be passed in the segue
latitudeToPass = selectedAnnotation.coordinate.latitude;
longitudeToPass = selectedAnnotation.coordinate.longitude;
photoTitleToPass = selectedAnnotation.title;
@@ -27,10 +27,11 @@ -(void)squishImage
-(void)lowerImageView
{
+
[UIView animateWithDuration:0.5
animations:^void(void)
{
- self.center = CGPointMake(self.center.x, self.center.y+229);
+ self.center = CGPointMake(self.center.x, self.frame.size.height/2 + 10);
//self.alpha = 0.90;
}];
}
@@ -41,7 +42,7 @@ -(void)raiseImageView
[UIView animateWithDuration:0.5
animations:^void(void)
{
- self.center = CGPointMake(self.center.x, self.center.y-229);
+ self.center = CGPointMake(self.center.x, self.center.y - self.frame.size.height * 1.5 - 10);
//self.alpha = 0.90;
}];
}
@@ -66,8 +66,11 @@ - (void)viewDidLoad
{
// .latitudeDelta = 0.01810686f,
// .longitudeDelta = 0.01810686f
- .latitudeDelta = 0.01450686f,
- .longitudeDelta = 0.01450686f
+// .latitudeDelta = 0.01450686f,
+// .longitudeDelta = 0.01450686f
+
+ .latitudeDelta = 0.00750686f,
+ .longitudeDelta = 0.00750686f
};
MKCoordinateRegion originRegion = {originLocationCoordinate, originSpan};
@@ -79,7 +79,7 @@
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="l7g-9r-gcH">
- <rect key="frame" x="257" y="-5" width="48" height="44"/>
+ <rect key="frame" x="274" y="-5" width="31" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="closeButton@2x.png">
@@ -93,6 +93,21 @@
<action selector="closePhotoButtonPressed:" destination="L5I-mE-d7D" eventType="touchUpInside" id="NhX-y6-FHl"/>
</connections>
</button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="kbm-YI-FPA">
+ <rect key="frame" x="0.0" y="0.0" width="266" height="186"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+ <state key="normal">
+ <color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="highlighted">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <connections>
+ <action selector="fullSizedPhotoTapped:" destination="L5I-mE-d7D" eventType="touchUpInside" id="GwE-2G-FJ9"/>
+ </connections>
+ </button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
@@ -123,6 +138,20 @@
<rect key="frame" x="103" y="113" width="119" height="131"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
+ <view contentMode="scaleToFill" id="ycE-pM-AOQ">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gAj-UA-Pxs">
+ <rect key="frame" x="20" y="85" width="280" height="463"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
@@ -392,6 +421,50 @@
<image name="webviewpopout_shelf@2x.png" width="640" height="94"/>
<image name="yelpMapViewShader@2x.png" width="640" height="390"/>
</resources>
+ <classes>
+ <class className="BookmarksViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/BookmarksViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="tableViewOutlet" candidateClass="UITableView"/>
+ </relationships>
+ </class>
+ <class className="FlickrMapViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/FlickrMapViewController.h"/>
+ <relationships>
+ <relationship kind="action" name="closePhotoButtonPressed:"/>
+ <relationship kind="action" name="fullSizedPhotoTapped:"/>
+ <relationship kind="outlet" name="enlargedPhotoViewOutlet" candidateClass="UIView"/>
+ <relationship kind="outlet" name="loadingOverlay" candidateClass="UIView"/>
+ <relationship kind="outlet" name="mapView" candidateClass="MKMapView"/>
+ <relationship kind="outlet" name="photoViewerUIImageView" candidateClass="UIImageView"/>
+ </relationships>
+ </class>
+ <class className="HistoryViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/HistoryViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="historyTableViewOutlet" candidateClass="UITableView"/>
+ </relationships>
+ </class>
+ <class className="YelpMapViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/YelpMapViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="photoViewerUIImageView" candidateClass="UIImageView"/>
+ <relationship kind="outlet" name="yelpMapView" candidateClass="MKMapView"/>
+ </relationships>
+ </class>
+ <class className="YelpWebPageBrowser" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/YelpWebPageBrowser.h"/>
+ <relationships>
+ <relationship kind="action" name="backButtonPress:"/>
+ <relationship kind="action" name="forwardButtonPress:"/>
+ <relationship kind="outlet" name="backButton" candidateClass="UIButton"/>
+ <relationship kind="outlet" name="forwardButton" candidateClass="UIButton"/>
+ <relationship kind="outlet" name="popoutView" candidateClass="UIView"/>
+ <relationship kind="outlet" name="popoutViewTextLabel" candidateClass="UILabel"/>
+ <relationship kind="outlet" name="webView" candidateClass="UIWebView"/>
+ </relationships>
+ </class>
+ </classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>

0 comments on commit a62b6d3

Please sign in to comment.