Permalink
Browse files

Added circular bevel to annotations

  • Loading branch information...
1 parent 40c82ec commit e10f273a3dd11f060582a2401190fa21da6bcd19 @xirianlight xirianlight committed Mar 26, 2013
@@ -22,6 +22,7 @@
8335571616F6D27600DB17D5 /* YelpWebPageBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 8335571516F6D27600DB17D5 /* YelpWebPageBrowser.m */; };
8335571916F754C800DB17D5 /* xmark.png in Resources */ = {isa = PBXBuildFile; fileRef = 8335571816F754C800DB17D5 /* xmark.png */; };
8335571D16F7579600DB17D5 /* wifiIcon2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8335571C16F7579600DB17D5 /* wifiIcon2@2x.png */; };
+ 835876D817014080000A74A7 /* circleShine@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 835876D717014080000A74A7 /* circleShine@2x.png */; };
83B0D00516FA1A1900C9D8F8 /* BookmarksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B0D00416FA1A1900C9D8F8 /* BookmarksViewController.m */; };
83B0D00A16FA1A8900C9D8F8 /* HistoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B0D00916FA1A8900C9D8F8 /* HistoryViewController.m */; };
83BB6B6B16FA0A31003A4506 /* circleMask6464.png in Resources */ = {isa = PBXBuildFile; fileRef = 83BB6B6A16FA0A31003A4506 /* circleMask6464.png */; };
@@ -101,6 +102,7 @@
8335571516F6D27600DB17D5 /* YelpWebPageBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YelpWebPageBrowser.m; sourceTree = "<group>"; };
8335571816F754C800DB17D5 /* xmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = xmark.png; sourceTree = "<group>"; };
8335571C16F7579600DB17D5 /* wifiIcon2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wifiIcon2@2x.png"; sourceTree = "<group>"; };
+ 835876D717014080000A74A7 /* circleShine@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "circleShine@2x.png"; sourceTree = "<group>"; };
83B0D00316FA1A1900C9D8F8 /* BookmarksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BookmarksViewController.h; sourceTree = "<group>"; };
83B0D00416FA1A1900C9D8F8 /* BookmarksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BookmarksViewController.m; sourceTree = "<group>"; };
83B0D00816FA1A8900C9D8F8 /* HistoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryViewController.h; sourceTree = "<group>"; };
@@ -317,6 +319,7 @@
8F3AD83816F90A0300BEEB3A /* Custom Images */ = {
isa = PBXGroup;
children = (
+ 835876D717014080000A74A7 /* circleShine@2x.png */,
830E6BB8170135AE009FBD5B /* appIcon@2x.png */,
830E6BB9170135AE009FBD5B /* silverBG@2x.png */,
830E6BB617011E8B009FBD5B /* mapShadowTop@2x.png */,
@@ -463,6 +466,7 @@
830E6BB717011E8B009FBD5B /* mapShadowTop@2x.png in Resources */,
830E6BBA170135AE009FBD5B /* appIcon@2x.png in Resources */,
830E6BBB170135AE009FBD5B /* silverBG@2x.png in Resources */,
+ 835876D817014080000A74A7 /* circleShine@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -281,7 +281,8 @@ -(MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id<MKAnnotati
//Let's set that custom image
NSURL *flickrThumbnailURL = [NSURL URLWithString:selectedAnnotation.flickrThumbnailString];
NSData *photoData = [NSData dataWithContentsOfURL:flickrThumbnailURL];
- UIImage *photoThumbnailImage = [UIImage imageWithData:photoData];
+ UIImage *photoThumbnailImagePreShine = [UIImage imageWithData:photoData];
+ UIImage * photoThumbnailImage = [self addImage:photoThumbnailImagePreShine toImage:[UIImage imageNamed:@"CircleShine.png"]];
//Now mask the image
dispatch_async(newQueue,^void(void)
@@ -307,7 +308,7 @@ -(MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id<MKAnnotati
// UIGraphicsEndImageContext();
//Set the imageView inside the
- UIImageView *photoContainer = [[UIImageView alloc] initWithImage:photoThumbnailImage];
+ UIImageView *photoContainer = [[UIImageView alloc] initWithImage:photoThumbnailImagePreShine];
photoContainer.contentMode = UIViewContentModeScaleAspectFit;
@@ -335,6 +336,24 @@ -(MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id<MKAnnotati
return annotationView;
}
+//Annotation overlay method
+- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {
+ UIGraphicsBeginImageContext(image1.size);
+
+ // Draw image1
+ [image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)];
+
+ // Draw image2
+ [image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)];
+
+ UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
+
+ UIGraphicsEndImageContext();
+
+ return resultingImage;
+}
+
+
- (UIImage*) createMaskWith: (UIImage *)maskImage onImage:(UIImage*) subjectImage
{
CGImageRef maskRef = maskImage.CGImage;
@@ -140,7 +140,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Swipe to go forward or back" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="emB-3U-nsG">
- <rect key="frame" x="20" y="38" width="280" height="21"/>
+ <rect key="frame" x="20" y="12" width="280" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -350,6 +350,7 @@
<class className="FlickrMapViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/FlickrMapViewController.h"/>
<relationships>
+ <relationship kind="action" name="backToFlickrMapView:" candidateClass="UIStoryboardSegue"/>
<relationship kind="outlet" name="loadingOverlay" candidateClass="UIView"/>
<relationship kind="outlet" name="mapView" candidateClass="MKMapView"/>
</relationships>
@@ -360,6 +361,9 @@
<relationship kind="outlet" name="historyTableViewOutlet" candidateClass="UITableView"/>
</relationships>
</class>
+ <class className="UIStoryboardSegue" superclassName="NSObject">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/UIStoryboardSegue.h"/>
+ </class>
<class className="YelpMapViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/YelpMapViewController.h"/>
<relationships>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e10f273

Please sign in to comment.