-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiled map view #19
Merged
Merged
Tiled map view #19
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6a24123
Tiled map view.
dblock f14659f
Added tiles from the New York Armory Show 2014 map.
dblock cc5302d
Create a folder structure for locally stored tiles.
dblock 949ee95
Fixed zoom levels.
dblock 313af25
Invalidate the entire map view when zoom level changes.
dblock 42dd14d
Fixed warning with CGContextGetCTM called for a 0x0 context.
dblock 8a02202
Add annotations.
dblock 6c634f2
Updated master view controller test.
dblock c88326d
Removed Reveal framework.
dblock 0e999cc
Set global image reference directory in beforeAll.
dblock e0020b8
Aded README describing the tiled image view.
dblock 3b64ed5
Looks like Travis-CI is using a 4 inch simulator.
dblock 704623a
Removed unused tile levels.
dblock 3005451
Use tiles loaded from local cache.
dblock 4c04b36
Reduced screenshot size to fit README on Github.
dblock 0fa8a3f
Fixed space/tab.
dblock b2878ef
Clarified the README.
dblock 0cb3e0d
Make mapView a public property.
dblock 9700755
Renamed to downloadAndRedrawTilesWithURLs.
dblock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// NATiledImageDemoViewController.h | ||
// | ||
// Created by Daniel Doubrovkine on 3/10/14. | ||
// Copyright (c) 2014 neilang.com. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface NATiledImageDemoViewController : UIViewController | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// NATiledImageDemoViewController.m | ||
// Demo | ||
// | ||
// Created by Daniel Doubrovkine on 3/10/14. | ||
// Copyright (c) 2014 neilang.com. All rights reserved. | ||
// | ||
|
||
#import "NATiledImageDemoViewController.h" | ||
#import "NATiledImageMapView.h" | ||
#import "NADZTileImageDataSource.h" | ||
|
||
@interface NATiledImageDemoViewController () | ||
@property(nonatomic, readonly) NATiledImageMapView *mapView; | ||
@end | ||
|
||
@implementation NATiledImageDemoViewController | ||
|
||
-(void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
|
||
NADZTileImageDataSource *dzTileImageDataSource = [[NADZTileImageDataSource alloc] init]; | ||
dzTileImageDataSource.maxTiledHeight = 5389; | ||
dzTileImageDataSource.maxTiledWidth = 5000; | ||
dzTileImageDataSource.minTileLevel = 11; | ||
dzTileImageDataSource.maxTileLevel = ceil(log(MAX(dzTileImageDataSource.maxTiledWidth, dzTileImageDataSource.maxTiledHeight))/log(2)); | ||
dzTileImageDataSource.tileSize = 512; | ||
dzTileImageDataSource.tileFormat = @"jpg"; | ||
dzTileImageDataSource.tileBaseURL = [NSURL URLWithString:@"https://raw.github.com/dblock/NAMapKit/tiled-map-view/Demo/Maps/Armory2014/tiles"]; | ||
|
||
NATiledImageMapView *mapView = [[NATiledImageMapView alloc] initWithFrame:self.view.bounds tiledImageDataSource:dzTileImageDataSource]; | ||
mapView.backgroundColor = [UIColor colorWithRed:0.000f green:0.475f blue:0.761f alpha:1.000f]; | ||
mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | ||
// mapView.displayTileBorders = YES; | ||
mapView.backgroundImageURL = [NSURL URLWithString:@"https://raw.github.com/dblock/NAMapKit/tiled-map-view/Demo/Maps/Armory2014/large.jpg"]; | ||
_mapView = mapView; | ||
|
||
[self.view addSubview:mapView]; | ||
|
||
NAAnnotation *champagneBar = [NAAnnotation annotationWithPoint:[mapView coordinateFor:CGPointMake(0.30f, 0.10f)]]; | ||
[mapView addAnnotation:champagneBar animated:NO]; | ||
|
||
NAAnnotation *artsyBooth = [NAAnnotation annotationWithPoint:[mapView coordinateFor:CGPointMake(0.53f, 0.83f)]]; | ||
[mapView addAnnotation:artsyBooth animated:NO]; | ||
} | ||
|
||
-(void)viewDidAppear:(BOOL)animated | ||
{ | ||
[self.mapView zoomToFit:animated]; | ||
} | ||
|
||
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
{ | ||
return (interfaceOrientation == UIInterfaceOrientationPortrait); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// NATiledImageMapViewTests.m | ||
// | ||
// Created by Daniel Doubrovkine on 3/11/14. | ||
// Copyright (c) 2014 neilang.com. All rights reserved. | ||
// | ||
|
||
#import "NATiledImageDemoViewController.h" | ||
|
||
SpecBegin(NATiledImageDemoViewController) | ||
|
||
beforeAll(^{ | ||
setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR); | ||
}); | ||
|
||
__block NATiledImageDemoViewController *vc = nil; | ||
|
||
beforeEach(^{ | ||
vc = [[NATiledImageDemoViewController alloc] init]; | ||
expect(vc.view).willNot.beNil(); | ||
}); | ||
|
||
// TODO: drawRect isn't called when running in a test until the test has finished | ||
pending(@"displays map with a pin", ^{ | ||
[vc viewDidAppear:NO]; | ||
expect(vc.view).to.haveValidSnapshotNamed(@"default"); | ||
}); | ||
|
||
SpecEnd |
Binary file modified
BIN
+2.99 KB
(100%)
Demo/DemoTests/ReferenceImages/NAAnnotationDemoViewControllerSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.17 KB
(110%)
Demo/DemoTests/ReferenceImages/NAMasterViewControllerSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.17 KB
(100%)
...DemoTests/ReferenceImages/NAPinAnnotationsDemoViewControllerSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
# | ||
# Be sure to run `pod spec lint NAMapKit.podspec' to ensure this is a | ||
# valid spec and remove all comments before submitting the spec. | ||
# | ||
# To learn more about the attributes see http://docs.cocoapods.org/specification.html | ||
# | ||
Pod::Spec.new do |s| | ||
s.name = "NAMapKit" | ||
s.version = "2.1" | ||
s.version = "3.0" | ||
s.summary = "Allows you to use custom maps in MapKit compatible way." | ||
s.homepage = "https://github.com/neilang/NAMapKit" | ||
s.license = 'MIT' | ||
s.authors = { "Neil Ang" => "[email protected]", "Tony Arnold" => "[email protected]" } | ||
s.source = { :git => "https://github.com/neilang/NAMapKit.git", :tag => "v2.1" } | ||
s.platform = :ios, '6.0' | ||
|
||
s.source_files = "NaMapKit/*.{h,m}" | ||
s.resources = "NAMapKit/*.png" | ||
s.resources = "NAMapKit/*.png" | ||
s.frameworks = 'Foundation', 'UIKit', 'CoreGraphics' | ||
s.requires_arc = true | ||
s.dependencies = ['SDWebImage'] | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swanky.