aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNadia Barbosa <captainbarbosa@users.noreply.github.com>2018-01-26 10:12:29 -0500
committerNadia Barbosa <captainbarbosa@users.noreply.github.com>2018-01-26 10:46:26 -0500
commit01004dab6b42fd91de9f2059077b2b6b6c99edc1 (patch)
treece1857d1aaa4b469398692682b85e46f4de6ccee
parentfa5722479100875778d07427d817cd3c64d7aeca (diff)
Draft of MGLPinAnnotation
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj16
-rw-r--r--platform/ios/src/MGLPinAnnotationView.h12
-rw-r--r--platform/ios/src/MGLPinAnnotationView.m72
-rw-r--r--platform/ios/src/Mapbox.h1
4 files changed, 99 insertions, 2 deletions
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 05cbb11d0..358fb7f1c 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ 05B099B420123EAF0041C718 /* MGLPinAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 05B099B220123EAF0041C718 /* MGLPinAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 05B099B520123EAF0041C718 /* MGLPinAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 05B099B220123EAF0041C718 /* MGLPinAnnotationView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 05B099B620123EAF0041C718 /* MGLPinAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 05B099B320123EAF0041C718 /* MGLPinAnnotationView.m */; };
+ 05B099B720123EAF0041C718 /* MGLPinAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 05B099B320123EAF0041C718 /* MGLPinAnnotationView.m */; };
071BBAFF1EE7613E001FB02A /* MGLImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */; };
071BBB001EE7613F001FB02A /* MGLImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */; };
071BBB031EE76146001FB02A /* MGLImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 071BBAFC1EE75CD4001FB02A /* MGLImageSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -14,13 +18,13 @@
071BBB071EE77631001FB02A /* MGLImageSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 071BBB051EE7761A001FB02A /* MGLImageSourceTests.m */; };
0778DD431F67556700A73B34 /* MGLComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0778DD401F67555F00A73B34 /* MGLComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
0778DD441F67556C00A73B34 /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */; };
- 16376B491FFEED010000563E /* MGLMapViewLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 16376B481FFEED010000563E /* MGLMapViewLayoutTests.m */; };
07D8C6FB1F67560100381808 /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */; };
07D8C6FC1F67560400381808 /* MGLAbstractShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07D947501F67487E00E37934 /* MGLAbstractShapeSource.mm */; };
07D8C6FF1F67562C00381808 /* MGLComputedShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07D8C6FD1F67562800381808 /* MGLComputedShapeSourceTests.m */; };
07D947521F67488800E37934 /* MGLAbstractShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D9474F1F67487E00E37934 /* MGLAbstractShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
07D947531F67488E00E37934 /* MGLAbstractShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D9474E1F67487E00E37934 /* MGLAbstractShapeSource_Private.h */; };
07D947541F67489200E37934 /* MGLAbstractShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07D947501F67487E00E37934 /* MGLAbstractShapeSource.mm */; };
+ 16376B491FFEED010000563E /* MGLMapViewLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 16376B481FFEED010000563E /* MGLMapViewLayoutTests.m */; };
1753ED421E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; };
1753ED431E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; };
1F06668A1EC64F8E001C16D7 /* MGLLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0666881EC64F8E001C16D7 /* MGLLight.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -621,16 +625,18 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 05B099B220123EAF0041C718 /* MGLPinAnnotationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLPinAnnotationView.h; sourceTree = "<group>"; };
+ 05B099B320123EAF0041C718 /* MGLPinAnnotationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLPinAnnotationView.m; sourceTree = "<group>"; };
071BBAFC1EE75CD4001FB02A /* MGLImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLImageSource.h; sourceTree = "<group>"; };
071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLImageSource.mm; sourceTree = "<group>"; };
071BBB051EE7761A001FB02A /* MGLImageSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLImageSourceTests.m; path = ../../darwin/test/MGLImageSourceTests.m; sourceTree = "<group>"; };
0778DD401F67555F00A73B34 /* MGLComputedShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLComputedShapeSource.h; sourceTree = "<group>"; };
0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLComputedShapeSource.mm; sourceTree = "<group>"; };
07D8C6FD1F67562800381808 /* MGLComputedShapeSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLComputedShapeSourceTests.m; path = ../../darwin/test/MGLComputedShapeSourceTests.m; sourceTree = "<group>"; };
- 16376B481FFEED010000563E /* MGLMapViewLayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewLayoutTests.m; sourceTree = "<group>"; };
07D9474E1F67487E00E37934 /* MGLAbstractShapeSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAbstractShapeSource_Private.h; sourceTree = "<group>"; };
07D9474F1F67487E00E37934 /* MGLAbstractShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAbstractShapeSource.h; sourceTree = "<group>"; };
07D947501F67487E00E37934 /* MGLAbstractShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAbstractShapeSource.mm; sourceTree = "<group>"; };
+ 16376B481FFEED010000563E /* MGLMapViewLayoutTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewLayoutTests.m; sourceTree = "<group>"; };
1753ED411E53CE6F00A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = "<group>"; };
1F0666881EC64F8E001C16D7 /* MGLLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight.h; sourceTree = "<group>"; };
1F0666891EC64F8E001C16D7 /* MGLLight.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLight.mm; sourceTree = "<group>"; };
@@ -1749,6 +1755,8 @@
966FCF4A1F3A5C9200F2B6DE /* MGLUserLocationHeadingBeamLayer.h */,
966FCF4B1F3A5C9200F2B6DE /* MGLUserLocationHeadingBeamLayer.m */,
96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */,
+ 05B099B220123EAF0041C718 /* MGLPinAnnotationView.h */,
+ 05B099B320123EAF0041C718 /* MGLPinAnnotationView.m */,
);
name = Annotations;
sourceTree = "<group>";
@@ -1880,6 +1888,7 @@
DA8847F21CBAFA5100AB86E3 /* MGLMapCamera.h in Headers */,
3538AA1D1D542239008EC33D /* MGLForegroundStyleLayer.h in Headers */,
DA8847F51CBAFA5100AB86E3 /* MGLOfflineRegion.h in Headers */,
+ 05B099B420123EAF0041C718 /* MGLPinAnnotationView.h in Headers */,
DA737EE11D056A4E005BDA16 /* MGLMapViewDelegate.h in Headers */,
DA8848851CBB033F00AB86E3 /* FABKitProtocol.h in Headers */,
DA88481B1CBAFA6200AB86E3 /* MGLGeometry_Private.h in Headers */,
@@ -1972,6 +1981,7 @@
DA72620C1DEEE3480043BB89 /* MGLOpenGLStyleLayer.h in Headers */,
35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
96E516EE2000590900A02306 /* MGLAbstractShapeSource.h in Headers */,
+ 05B099B520123EAF0041C718 /* MGLPinAnnotationView.h in Headers */,
96E516F32000597100A02306 /* NSDictionary+MGLAdditions.h in Headers */,
96E516F02000595800A02306 /* NSBundle+MGLAdditions.h in Headers */,
96E516F920005A3500A02306 /* MGLFaux3DUserLocationAnnotationView.h in Headers */,
@@ -2487,6 +2497,7 @@
35CE61841D4165D9004F2359 /* UIColor+MGLAdditions.mm in Sources */,
DA8848561CBAFB9800AB86E3 /* MGLLocationManager.m in Sources */,
3EA93369F61CF70AFA50465D /* MGLRendererConfiguration.mm in Sources */,
+ 05B099B620123EAF0041C718 /* MGLPinAnnotationView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2576,6 +2587,7 @@
35CE61851D4165D9004F2359 /* UIColor+MGLAdditions.mm in Sources */,
DAA4E4241CBB730400178DFB /* MGLPolyline.mm in Sources */,
3EA9366247780E4F252652A8 /* MGLRendererConfiguration.mm in Sources */,
+ 05B099B720123EAF0041C718 /* MGLPinAnnotationView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/platform/ios/src/MGLPinAnnotationView.h b/platform/ios/src/MGLPinAnnotationView.h
new file mode 100644
index 000000000..b91645764
--- /dev/null
+++ b/platform/ios/src/MGLPinAnnotationView.h
@@ -0,0 +1,12 @@
+#import <Mapbox/Mapbox.h>
+
+MGL_EXPORT
+
+@interface MGLPinAnnotationView : MGLAnnotationView
+
+@property(nonatomic) UIColor *shadowColor;
+@property(nonatomic) UIColor *pinColor;
+@property(nonatomic) UIColor *strokeColor;
+@property(nonatomic) UIColor *innerColor;
+
+@end
diff --git a/platform/ios/src/MGLPinAnnotationView.m b/platform/ios/src/MGLPinAnnotationView.m
new file mode 100644
index 000000000..cfeff1e5c
--- /dev/null
+++ b/platform/ios/src/MGLPinAnnotationView.m
@@ -0,0 +1,72 @@
+#import "MGLPinAnnotationView.h"
+
+@implementation MGLPinAnnotationView
+
+- (instancetype)initWithReuseIdentifier:(nullable NSString *)reuseIdentifier {
+ self = [super initWithReuseIdentifier:reuseIdentifier];
+ _shadowColor = [UIColor blackColor];
+ _pinColor = [UIColor blueColor];
+ _strokeColor = [UIColor whiteColor];
+ _innerColor = [UIColor whiteColor];
+
+ return self;
+}
+
+- (void)drawRect:(CGRect)rect {
+
+ //// General Declarations
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ //// Group
+ {
+ //// Oval 2 Drawing
+ CGContextSaveGState(context);
+ CGContextSetAlpha(context, 0.1);
+
+ UIBezierPath* oval2Path = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(10, 40.61, 19, 8)];
+ [self.shadowColor setFill];
+ [oval2Path fill];
+
+ CGContextRestoreGState(context);
+
+
+ //// Group 2
+ {
+ //// Bezier 2 Drawing
+ UIBezierPath* bezier2Path = [UIBezierPath bezierPath];
+ [bezier2Path moveToPoint: CGPointMake(18.04, 43.43)];
+ [bezier2Path addCurveToPoint: CGPointMake(20.96, 43.43) controlPoint1: CGPointMake(18.85, 44.18) controlPoint2: CGPointMake(20.16, 44.17)];
+ [bezier2Path addCurveToPoint: CGPointMake(37, 19.55) controlPoint1: CGPointMake(20.96, 43.43) controlPoint2: CGPointMake(37, 29.24)];
+ [bezier2Path addCurveToPoint: CGPointMake(19.5, 2) controlPoint1: CGPointMake(37, 9.86) controlPoint2: CGPointMake(29.16, 2)];
+ [bezier2Path addCurveToPoint: CGPointMake(2, 19.55) controlPoint1: CGPointMake(9.84, 2) controlPoint2: CGPointMake(2, 9.86)];
+ [bezier2Path addCurveToPoint: CGPointMake(18.04, 43.43) controlPoint1: CGPointMake(2, 29.24) controlPoint2: CGPointMake(18.04, 43.43)];
+ [bezier2Path closePath];
+ bezier2Path.usesEvenOddFillRule = YES;
+ [self.pinColor setFill];
+ [bezier2Path fill];
+
+
+ //// Bezier 3 Drawing
+ UIBezierPath* bezier3Path = [UIBezierPath bezierPath];
+ [bezier3Path moveToPoint: CGPointMake(18.04, 43.43)];
+ [bezier3Path addCurveToPoint: CGPointMake(20.96, 43.43) controlPoint1: CGPointMake(18.85, 44.18) controlPoint2: CGPointMake(20.16, 44.17)];
+ [bezier3Path addCurveToPoint: CGPointMake(37, 19.55) controlPoint1: CGPointMake(20.96, 43.43) controlPoint2: CGPointMake(37, 29.24)];
+ [bezier3Path addCurveToPoint: CGPointMake(19.5, 2) controlPoint1: CGPointMake(37, 9.86) controlPoint2: CGPointMake(29.16, 2)];
+ [bezier3Path addCurveToPoint: CGPointMake(2, 19.55) controlPoint1: CGPointMake(9.84, 2) controlPoint2: CGPointMake(2, 9.86)];
+ [bezier3Path addCurveToPoint: CGPointMake(18.04, 43.43) controlPoint1: CGPointMake(2, 29.24) controlPoint2: CGPointMake(18.04, 43.43)];
+ [bezier3Path closePath];
+ [self.strokeColor setStroke];
+ bezier3Path.lineWidth = 3;
+ [bezier3Path stroke];
+
+
+ //// Oval Drawing
+ UIBezierPath* ovalPath = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(12.5, 12.16, 14, 14)];
+ [self.innerColor setFill];
+ [ovalPath fill];
+ }
+ }
+
+}
+
+@end
diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h
index ce9c4965d..00942b0a2 100644
--- a/platform/ios/src/Mapbox.h
+++ b/platform/ios/src/Mapbox.h
@@ -33,6 +33,7 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[];
#import "MGLPointCollection.h"
#import "MGLPolygon.h"
#import "MGLPolyline.h"
+#import "MGLPinAnnotationView.h"
#import "MGLShape.h"
#import "MGLShapeCollection.h"
#import "MGLStyle.h"