Authored by Justin R. Miller

Merge branch 'develop' into release

Pod::Spec.new do |m|
m.name = 'MapBox'
m.version = '1.0.1'
m.version = '1.0.2'
m.summary = 'Open source alternative to MapKit.'
m.description = 'Open source alternative to MapKit supporting custom tile sources, offline use, and complete cache control.'
... ...
... ... @@ -57,6 +57,9 @@
/** The circle's fill color. Defaults to blue. */
@property (nonatomic, strong) UIColor *fillColor;
/** The fill pattern image of the circle. If set, the fillColor is set to `nil`. */
@property (nonatomic, strong) UIImage *fillPatternImage;
/** The radius of the circle in projected meters. Regardless of map zoom, the circle will change visible size to continously represent this radius on the map. */
@property (nonatomic, assign) CGFloat radiusInMeters;
... ...
... ... @@ -124,6 +124,9 @@
[self.shapeLayer setFillColor:[fillColor CGColor]];
[self.shapeLayer setStrokeColor:[lineColor CGColor]];
[self.shapeLayer setLineWidth:lineWidthInPixels];
if (self.fillPatternImage)
self.shapeLayer.fillColor = [[UIColor colorWithPatternImage:self.fillPatternImage] CGColor];
}
#pragma mark - Accessors
... ... @@ -169,6 +172,18 @@
}
}
- (void)setFillPatternImage:(UIImage *)fillPatternImage
{
if (fillPatternImage)
self.fillColor = nil;
if (_fillPatternImage != fillPatternImage)
{
_fillPatternImage = fillPatternImage;
[self updateCirclePathAnimated:NO];
}
}
- (void)setRadiusInMeters:(CGFloat)newRadiusInMeters
{
radiusInMeters = newRadiusInMeters;
... ...
... ... @@ -31,7 +31,7 @@
bool RMProjectedPointEqualToProjectedPoint(RMProjectedPoint point1, RMProjectedPoint point2)
{
return point1.x == point2.x && point2.y == point2.y;
return point1.x == point2.x && point1.y == point2.y;
}
bool RMProjectedRectIntersectsProjectedRect(RMProjectedRect rect1, RMProjectedRect rect2)
... ...
... ... @@ -52,7 +52,11 @@
- (id)init
{
return [self initWithMapID:([[UIScreen mainScreen] scale] > 1.0 ? kMapBoxPlaceholderRetinaMapID : kMapBoxPlaceholderNormalMapID)];
BOOL useRetina = ([[UIScreen mainScreen] scale] > 1.0);
NSString *localTileJSONPath = [RMMapView pathForBundleResourceNamed:(useRetina ? kMapBoxPlaceholderRetinaMapID : kMapBoxPlaceholderNormalMapID) ofType:@"json"];
return [self initWithReferenceURL:[NSURL fileURLWithPath:localTileJSONPath]];
}
- (id)initWithMapID:(NSString *)mapID
... ...
... ... @@ -138,6 +138,9 @@ typedef enum : NSUInteger {
/** @name Initializing a Map View */
/** Initialize a map view with a given frame. A default watermarked MapBox map tile source will be used. */
- (id)initWithFrame:(CGRect)frame;
/** Initialize a map view with a given frame and tile source.
* @param frame The frame with which to initialize the map view.
* @param newTilesource The tile source to use for the map tiles.
... ... @@ -164,6 +167,7 @@ typedef enum : NSUInteger {
- (void)setFrame:(CGRect)frame;
+ (UIImage *)resourceImageNamed:(NSString *)imageName;
+ (NSString *)pathForBundleResourceNamed:(NSString *)name ofType:(NSString *)extension;
#pragma mark - Movement
... ...
... ... @@ -405,16 +405,20 @@
+ (UIImage *)resourceImageNamed:(NSString *)imageName
{
NSAssert([[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"], @"Resource bundle not found in application.");
if ( ! [[imageName pathExtension] length])
imageName = [imageName stringByAppendingString:@".png"];
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"];
return [UIImage imageWithContentsOfFile:[[self class] pathForBundleResourceNamed:imageName ofType:nil]];
}
+ (NSString *)pathForBundleResourceNamed:(NSString *)name ofType:(NSString *)extension
{
NSAssert([[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"], @"Resource bundle not found in application.");
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"];
NSBundle *resourcesBundle = [NSBundle bundleWithPath:bundlePath];
NSString *imagePath = [resourcesBundle pathForResource:imageName ofType:nil];
return [UIImage imageWithContentsOfFile:imagePath];
return [resourcesBundle pathForResource:name ofType:extension];
}
- (void)dealloc
... ... @@ -2930,12 +2934,11 @@
{
[_annotations removeObject:annotation];
[_visibleAnnotations removeObject:annotation];
[self.quadTree removeAnnotation:annotation];
annotation.layer = nil;
}
[self.quadTree removeAnnotation:annotation];
// Remove the layer from the screen
annotation.layer = nil;
[self correctPositionOfAllAnnotations];
}
- (void)removeAnnotations:(NSArray *)annotationsToRemove
... ...
... ... @@ -66,6 +66,9 @@
/** The fill color of the shape. Defaults to clear. */
@property (nonatomic, strong) UIColor *fillColor;
/** The fill pattern image of the shape. If set, the fillColor is set to `nil`. */
@property (nonatomic, strong) UIImage *fillPatternImage;
@property (nonatomic, weak) NSArray *lineDashLengths;
@property (nonatomic, assign) CGFloat lineDashPhase;
@property (nonatomic, assign) BOOL scaleLineDash;
... ...
... ... @@ -123,6 +123,9 @@
shapeLayer.lineWidth = scaledLineWidth;
if (self.fillPatternImage)
shapeLayer.fillColor = [[UIColor colorWithPatternImage:self.fillPatternImage] CGColor];
if (lineDashLengths)
{
if (scaleLineDash)
... ... @@ -516,6 +519,18 @@
}
}
- (void)setFillPatternImage:(UIImage *)fillPatternImage
{
if (fillPatternImage)
self.fillColor = nil;
if (_fillPatternImage != fillPatternImage)
{
_fillPatternImage = fillPatternImage;
[self recalculateGeometryAnimated:NO];
}
}
- (CGFloat)shadowBlur
{
return shapeLayer.shadowRadius;
... ...
{"attribution":"<a href='http://mapbox.com/about/maps' target='_blank'>Terms & Feedback</a>","bounds":[-180,-85.0511,180,85.0511],"center":[0,0,3],"description":"","geocoder":"http://a.tiles.mapbox.com/v3/examples.map-z2effxa8/geocode/{query}.jsonp","id":"examples.map-z2effxa8","maxzoom":19,"minzoom":0,"name":"MapBox iOS Example","private":true,"scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://b.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://c.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png","http://d.tiles.mapbox.com/v3/examples.map-z2effxa8/{z}/{x}/{y}.png"],"webpage":"http://tiles.mapbox.com/examples/map/map-z2effxa8"}
\ No newline at end of file
... ...
{"attribution":"<a href='http://mapbox.com/about/maps' target='_blank'>Terms & Feedback</a>","bounds":[-180,-85.0511,180,85.0511],"center":[0,0,3],"description":"","geocoder":"http://a.tiles.mapbox.com/v3/examples.map-zswgei2n/geocode/{query}.jsonp","id":"examples.map-zswgei2n","maxzoom":19,"minzoom":0,"name":"MapBox iOS Example (Retina)","private":true,"scheme":"xyz","tilejson":"2.0.0","tiles":["http://a.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://b.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://c.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png","http://d.tiles.mapbox.com/v3/examples.map-zswgei2n/{z}/{x}/{y}.png"],"webpage":"http://tiles.mapbox.com/examples/map/map-zswgei2n"}
\ No newline at end of file
... ...
... ... @@ -87,6 +87,8 @@
DD1985C2165C5F6400DF667F /* RMTileMillSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1985C0165C5F6400DF667F /* RMTileMillSource.m */; };
DD1E3C6E161F954F004FC649 /* SMCalloutView.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1E3C6C161F954F004FC649 /* SMCalloutView.h */; };
DD1E3C6F161F954F004FC649 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1E3C6D161F954F004FC649 /* SMCalloutView.m */; };
DD280D1416EFDDD30014B549 /* examples.map-z2effxa8.json in Resources */ = {isa = PBXBuildFile; fileRef = DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */; };
DD280D1516EFDDD30014B549 /* examples.map-zswgei2n.json in Resources */ = {isa = PBXBuildFile; fileRef = DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */; };
DD2B374514CF8041008DE8CB /* FMDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2B373F14CF8041008DE8CB /* FMDatabase.h */; };
DD2B374614CF8041008DE8CB /* FMDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2B374014CF8041008DE8CB /* FMDatabase.m */; };
DD2B374714CF8041008DE8CB /* FMDatabaseAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2B374114CF8041008DE8CB /* FMDatabaseAdditions.h */; };
... ... @@ -245,6 +247,8 @@
DD1985C0165C5F6400DF667F /* RMTileMillSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMTileMillSource.m; sourceTree = "<group>"; };
DD1E3C6C161F954F004FC649 /* SMCalloutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SMCalloutView.h; path = SMCalloutView/SMCalloutView.h; sourceTree = "<group>"; };
DD1E3C6D161F954F004FC649 /* SMCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SMCalloutView.m; path = SMCalloutView/SMCalloutView.m; sourceTree = "<group>"; };
DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "examples.map-z2effxa8.json"; path = "Map/Resources/examples.map-z2effxa8.json"; sourceTree = "<group>"; };
DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "examples.map-zswgei2n.json"; path = "Map/Resources/examples.map-zswgei2n.json"; sourceTree = "<group>"; };
DD2B373F14CF8041008DE8CB /* FMDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabase.h; sourceTree = "<group>"; };
DD2B374014CF8041008DE8CB /* FMDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FMDatabase.m; sourceTree = "<group>"; };
DD2B374114CF8041008DE8CB /* FMDatabaseAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FMDatabaseAdditions.h; sourceTree = "<group>"; };
... ... @@ -611,6 +615,8 @@
DD932BB0165C287000D69D49 /* TrackingHeading@2x.png */,
DD932BB1165C287000D69D49 /* TrackingLocation.png */,
DD932BB2165C287000D69D49 /* TrackingLocation@2x.png */,
DD280D1216EFDDD30014B549 /* examples.map-z2effxa8.json */,
DD280D1316EFDDD30014B549 /* examples.map-zswgei2n.json */,
);
name = Resources;
path = ..;
... ... @@ -814,6 +820,8 @@
DD94D46B16C2E064003D5739 /* HeadingAngleLarge@2x.png in Resources */,
DD94D46C16C2E064003D5739 /* HeadingAngleMedium.png in Resources */,
DD94D46D16C2E064003D5739 /* HeadingAngleMedium@2x.png in Resources */,
DD280D1416EFDDD30014B549 /* examples.map-z2effxa8.json in Resources */,
DD280D1516EFDDD30014B549 /* examples.map-zswgei2n.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ...