├── Screenshots
├── screen00.png
├── screen01.png
└── screen02.png
├── FSInteractiveMap.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── Package.swift
├── FSInteractiveMapDemo
├── AppDelegate.h
├── main.m
├── DetailViewController.h
├── MasterViewController.h
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── MasterViewController.m
├── AppDelegate.m
├── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── DetailViewController.m
└── FSInteractiveMap
│ └── Data
│ ├── austria-low.svg
│ ├── beef-cuts.svg
│ ├── usa-low.svg
│ └── france-low.svg
├── Sources
└── FSInteractiveMap
│ ├── FSSVGUtils.h
│ ├── FSSVG.h
│ ├── FSSVGPathElement.h
│ ├── include
│ └── FSInteractiveMapView.h
│ ├── FSSVG.m
│ ├── FSSVGUtils.m
│ ├── FSInteractiveMapView.m
│ └── FSSVGPathElement.m
├── .gitignore
├── FSInteractiveMap.podspec
├── README.md
├── Tests
└── FSInteractiveMapTests
│ └── FSSVGParsingTests.m
└── LICENSE
/Screenshots/screen00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wordpress-mobile/FSInteractiveMap/trunk/Screenshots/screen00.png
--------------------------------------------------------------------------------
/Screenshots/screen01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wordpress-mobile/FSInteractiveMap/trunk/Screenshots/screen01.png
--------------------------------------------------------------------------------
/Screenshots/screen02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wordpress-mobile/FSInteractiveMap/trunk/Screenshots/screen02.png
--------------------------------------------------------------------------------
/FSInteractiveMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FSInteractiveMap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.10
2 |
3 | import Foundation
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "FSInteractiveMap",
8 | platforms: [.iOS(.v14)],
9 | products: [
10 | .library(name: "FSInteractiveMap", targets: ["FSInteractiveMap"])
11 | ],
12 | targets: [
13 | .target(name: "FSInteractiveMap")
14 | ]
15 | )
16 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVGUtils.h:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVGUtils.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 24/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FSSVGUtils : NSObject
12 |
13 | + (NSArray*)parsePoints:(const char *)str;
14 | + (CGAffineTransform)parseTransform:(NSString*)str;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/DetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DetailViewController : UIViewController
12 |
13 | @property (strong, nonatomic) id detailItem;
14 | @property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/MasterViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class DetailViewController;
12 |
13 | @interface MasterViewController : UITableViewController
14 |
15 | @property (strong, nonatomic) DetailViewController *detailViewController;
16 |
17 |
18 | @end
19 |
20 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVG.h:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVG.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 22/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "FSSVGUtils.h"
12 | #import "FSSVGPathElement.h"
13 |
14 | @interface FSSVG : NSObject
15 |
16 | @property (nonatomic, strong) NSMutableArray* paths;
17 | @property (nonatomic) CGRect bounds;
18 |
19 | + (instancetype)svgWithFile:(NSString*)filePath;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
28 | # SPM
29 | .swiftpm
30 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVGPathElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVGPathElement.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 22/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface FSSVGPathElement : NSObject
13 |
14 | @property (nonatomic, strong) NSString* title;
15 | @property (nonatomic, strong) NSString* identifier;
16 | @property (nonatomic, strong) NSString* className;
17 | @property (nonatomic, strong) NSString* tranform;
18 | @property (nonatomic, strong) UIBezierPath* path;
19 | @property (nonatomic) BOOL fill;
20 |
21 | - (instancetype)initWithAttributes:(NSDictionary *)attributes;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/FSInteractiveMap.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "FSInteractiveMap"
3 | s.version = "0.1.0"
4 | s.summary = "FSInteractiveMap is a charting library to visualize and interact with a vector map on iOS."
5 | s.description = <<-DESC
6 | It's like Geochart but for iOS. It's loading the maps from simple SVG files. It lets you visualize and interact with a vector map on iOS.
7 | DESC
8 | s.homepage = "https://github.com/ArthurGuibert/FSInteractiveMap"
9 | s.screenshots = "https://github.com/ArthurGuibert/FSInteractiveMap/raw/master/Screenshots/screen02.png"
10 | s.author = { "Arthur Guibert" => "birslip@gmail.com" }
11 | s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
12 | s.platform = :ios, '7.0'
13 | s.source = { :git => "https://github.com/ArthurGuibert/FSInteractiveMap.git",:tag => "#{s.version}" }
14 | s.source_files = 'Classes', 'FSInteractiveMap/FSInteractiveMap/**/*.{h,m}'
15 | s.requires_arc = true
16 | end
17 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/include/FSInteractiveMapView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FSInteractiveMapView.h
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 23/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FSInteractiveMapView : UIView
12 |
13 | // Graphical properties
14 | @property (nonatomic, strong) UIColor* fillColor;
15 | @property (nonatomic, strong) UIColor* strokeColor;
16 |
17 | // Click handler
18 | @property (nonatomic, copy) void (^clickHandler)(NSString* identifier, CAShapeLayer* layer);
19 |
20 | // Loading functions
21 | - (void)loadMap:(NSString*)mapName withColors:(NSDictionary*)colorsDict;
22 | - (void)loadMap:(NSString*)mapName withData:(NSDictionary*)data colorAxis:(NSArray*)colors;
23 |
24 | // Set the colors by element, if you want to make the map dynamic or update the colors
25 | - (void)setColors:(NSDictionary*)colorsDict;
26 | - (void)setData:(NSDictionary*)data colorAxis:(NSArray*)colors;
27 |
28 | // Layers enumeration
29 | - (void)enumerateLayersUsingBlock:(void(^)(NSString* identifier, CAShapeLayer* layer))block;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIStatusBarTintParameters
34 |
35 | UINavigationBar
36 |
37 | Style
38 | UIBarStyleDefault
39 | Translucent
40 |
41 |
42 |
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UISupportedInterfaceOrientations~ipad
50 |
51 | UIInterfaceOrientationPortrait
52 | UIInterfaceOrientationPortraitUpsideDown
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/MasterViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "MasterViewController.h"
10 | #import "DetailViewController.h"
11 |
12 | @interface MasterViewController ()
13 |
14 | @property NSArray *examples;
15 |
16 | @end
17 |
18 | @implementation MasterViewController
19 |
20 | - (void)awakeFromNib {
21 | [super awakeFromNib];
22 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
23 | self.clearsSelectionOnViewWillAppear = NO;
24 | self.preferredContentSize = CGSizeMake(320.0, 600.0);
25 | }
26 | }
27 |
28 | - (void)viewDidLoad {
29 | [super viewDidLoad];
30 | // Do any additional setup after loading the view, typically from a nib.
31 |
32 | _examples = @[@"Example 1", @"Example 2", @"Example 3", @"Example 4"];
33 |
34 | self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
35 | }
36 |
37 | - (void)didReceiveMemoryWarning {
38 | [super didReceiveMemoryWarning];
39 | // Dispose of any resources that can be recreated.
40 | }
41 |
42 | #pragma mark - Segues
43 |
44 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
45 | if ([[segue identifier] isEqualToString:@"showDetail"]) {
46 | NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
47 | NSDate *object = self.examples[indexPath.row];
48 | DetailViewController *controller = (DetailViewController *)[[segue destinationViewController] topViewController];
49 | [controller setDetailItem:object];
50 | controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem;
51 | controller.navigationItem.leftItemsSupplementBackButton = YES;
52 | }
53 | }
54 |
55 | #pragma mark - Table View
56 |
57 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
58 | return 1;
59 | }
60 |
61 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
62 | return self.examples.count;
63 | }
64 |
65 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
66 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
67 |
68 | NSDate *object = self.examples[indexPath.row];
69 | cell.textLabel.text = [object description];
70 | return cell;
71 | }
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "DetailViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 | UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
22 | UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
23 | navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
24 | splitViewController.delegate = self;
25 | return YES;
26 | }
27 |
28 | - (void)applicationWillResignActive:(UIApplication *)application {
29 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
30 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
31 | }
32 |
33 | - (void)applicationDidEnterBackground:(UIApplication *)application {
34 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
36 | }
37 |
38 | - (void)applicationWillEnterForeground:(UIApplication *)application {
39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
40 | }
41 |
42 | - (void)applicationDidBecomeActive:(UIApplication *)application {
43 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
44 | }
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 | #pragma mark - Split view
51 |
52 | - (BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController {
53 | if ([secondaryViewController isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[DetailViewController class]] && ([(DetailViewController *)[(UINavigationController *)secondaryViewController topViewController] detailItem] == nil)) {
54 | // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
55 | return YES;
56 | } else {
57 | return NO;
58 | }
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FSInteractiveMap
2 | ================
3 |
4 | This fork is used by [WordPress iOS](https://github.com/wordpress-mobile/WordPress-iOS). It required some bugfixes and unfortunately the original project doesn’t appear to be maintained.
5 |
6 | ---
7 |
8 | A charting library to visualize data on a map. It's like geochart but for iOS!
9 |
10 | The idea behind this library is to load a SVG file of a map and display it simply in a view. On top of that you can know when a specific area is clicked.
11 |
12 | Please note that the SVG loading is quite simple and doesn't support all the features of the SVG file format. It's just good enough to display most of the maps I found in SVG!
13 |
14 | Screenshots
15 | ---
16 |
17 |
18 | Installing FSInteractiveMap
19 | ---
20 | Add the contents of the FSInteractiveMap project to your directory or simply add the following line to your Podfile:
21 |
22 | pod "FSInteractiveMap"
23 |
24 |
25 | How to use
26 | ---
27 | FSInteractiveMap is a subclass of UIView so it can be added as regular view. It's basically loading a map from a SVG file. I bundled a few svg maps in the example but you can add any SVG to your project and load it.
28 |
29 | ```objc
30 | NSDictionary* data = @{ @"asia" : @12,
31 | @"australia" : @2,
32 | @"north_america" : @5,
33 | @"south_america" : @14,
34 | @"africa" : @5,
35 | @"europe" : @20
36 | };
37 |
38 | FSInteractiveMapView* map = [[FSInteractiveMapView alloc] initWithFrame:self.view.frame];
39 |
40 | [map loadMap:@"world-continents-low" withData:data colorAxis:@[[UIColor lightGrayColor], [UIColor darkGrayColor]]];
41 |
42 | [map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
43 | self.detailDescriptionLabel.text = [NSString stringWithFormat:@"Continent clicked: %@", identifier];
44 | }];
45 | ```
46 |
47 | An example of a "clickable" map:
48 |
49 | ```objc
50 | FSInteractiveMapView* map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(16, 96, self.view.frame.size.width - 32, 500)];
51 | [map loadMap:@"usa-low" withColors:nil];
52 |
53 | [map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
54 | if(_oldClickedLayer) {
55 | _oldClickedLayer.zPosition = 0;
56 | _oldClickedLayer.shadowOpacity = 0;
57 | }
58 |
59 | _oldClickedLayer = layer;
60 |
61 | // We set a simple effect on the layer clicked to highlight it
62 | layer.zPosition = 10;
63 | layer.shadowOpacity = 0.5;
64 | layer.shadowColor = [UIColor blackColor].CGColor;
65 | layer.shadowRadius = 5;
66 | layer.shadowOffset = CGSizeMake(0, 0);
67 | }];
68 | ```
69 |
70 | How to find SVG maps
71 | ---
72 | There are a few places where you can find svg files that are suitable for FSInteractiveMap. Here is a short list:
73 | - http://www.amcharts.com/svg-maps/
74 | - http://www.highcharts.com/maps/demo#custom/world-continents
75 | - Wikipedia
76 |
77 | Contact & Issues
78 | ---
79 | If you have any issues please let me know in the issue part of this project.
80 | For any other things you can reach me on twitter or by email.
81 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVG.m:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVG.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 22/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "FSSVG.h"
10 |
11 | @interface FSSVG()
12 | @property (nonatomic, strong) NSMutableArray* transforms;
13 | @property (nonatomic) CGAffineTransform currentTransform;
14 | @end
15 |
16 | @implementation FSSVG
17 |
18 | + (instancetype)svgWithFile:(NSString*)filePath
19 | {
20 | return [[FSSVG alloc] initWithFile:filePath];
21 | }
22 |
23 | - (id)initWithFile:(NSString*)filename
24 | {
25 | self = [super init];
26 |
27 | if(self) {
28 | _paths = [NSMutableArray array];
29 | _transforms = [NSMutableArray array];
30 | _currentTransform = CGAffineTransformIdentity;
31 |
32 | NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:filename ofType:@"svg"]];
33 | NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data];
34 | parser.delegate = self;
35 | [parser parse];
36 | [self computeBounds];
37 | }
38 |
39 | return self;
40 | }
41 |
42 | #pragma mark - Xml Parsing
43 |
44 | - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
45 |
46 | if([elementName isEqualToString:@"path"])
47 | {
48 | FSSVGPathElement* element = [[FSSVGPathElement alloc] initWithAttributes:attributeDict];
49 | if(element.path) {
50 | [_paths addObject:element];
51 | }
52 |
53 | CGAffineTransform t = _currentTransform;
54 |
55 | if([attributeDict objectForKey:@"transform"]) {
56 | CGAffineTransform pathTransform = [FSSVGUtils parseTransform:[attributeDict objectForKey:@"transform"]];
57 | t = CGAffineTransformConcat(pathTransform, _currentTransform);
58 | }
59 |
60 | [element.path applyTransform:t];
61 | }
62 | else if([elementName isEqualToString:@"g"])
63 | {
64 | // Push
65 | CGAffineTransform t = CGAffineTransformIdentity;
66 |
67 | if([attributeDict objectForKey:@"transform"]) {
68 | t = [FSSVGUtils parseTransform:[attributeDict objectForKey:@"transform"]];
69 | }
70 |
71 | _currentTransform = CGAffineTransformConcat(t, _currentTransform);
72 | [_transforms addObject:NSStringFromCGAffineTransform(_currentTransform)];
73 | }
74 | }
75 |
76 | - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
77 | if([elementName isEqualToString:@"g"])
78 | {
79 | // Pop
80 | [_transforms removeLastObject];
81 |
82 | if([_transforms count] > 0 ) {
83 | _currentTransform = CGAffineTransformFromString([_transforms lastObject]);
84 | } else {
85 | _currentTransform = CGAffineTransformIdentity;
86 | }
87 | }
88 | }
89 |
90 | #pragma mark - Bounds
91 |
92 | - (void)computeBounds
93 | {
94 | _bounds.origin.x = MAXFLOAT;
95 | _bounds.origin.y = MAXFLOAT;
96 | float maxx = -MAXFLOAT;
97 | float maxy = -MAXFLOAT;
98 |
99 | for (FSSVGPathElement* path in _paths) {
100 | CGRect b = CGPathGetPathBoundingBox(path.path.CGPath);
101 |
102 | if(b.origin.x < _bounds.origin.x)
103 | _bounds.origin.x = b.origin.x;
104 |
105 | if(b.origin.y < _bounds.origin.y)
106 | _bounds.origin.y = b.origin.y;
107 |
108 | if(b.origin.x + b.size.width > maxx)
109 | maxx = b.origin.x + b.size.width;
110 |
111 | if(b.origin.y + b.size.height > maxy)
112 | maxy = b.origin.y + b.size.height;
113 | }
114 |
115 | _bounds.size.width = maxx - _bounds.origin.x;
116 | _bounds.size.height = maxy - _bounds.origin.y;
117 | }
118 |
119 | @end
120 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVGUtils.m:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVGUtils.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 24/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FSSVGUtils.h"
11 |
12 | @implementation FSSVGUtils
13 |
14 | + (NSArray*)parsePoints:(const char *)str
15 | {
16 | NSScanner *scanner = [NSScanner scannerWithString:[NSString stringWithUTF8String:str]];
17 | [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"\n, "]];
18 |
19 | NSMutableArray* array = [NSMutableArray array];
20 |
21 | float value = 0;
22 | while([scanner scanFloat:&value]) {
23 | NSNumber* number = [NSNumber numberWithFloat:value];
24 | [array addObject:number];
25 | }
26 |
27 | return array;
28 | }
29 |
30 | + (CGAffineTransform)parseTransform:(NSString*)str
31 | {
32 | CGAffineTransform tranform = CGAffineTransformIdentity;
33 |
34 | if([str length] > 0) {
35 | tranform = CGAffineTransformConcat(tranform, [self parseMatrix:str]);
36 | tranform = CGAffineTransformConcat(tranform, [self parseTranslate:str]);
37 | }
38 |
39 | return tranform;
40 | }
41 |
42 | + (CGAffineTransform)parseMatrix:(NSString*)str
43 | {
44 | CGAffineTransform tranform = CGAffineTransformIdentity;
45 | NSRange range = NSMakeRange(0, [str length]);
46 | NSString* patternMatrix = @"matrix\\((.*)\\)";
47 | NSError* regexError = nil;
48 |
49 | NSRegularExpression* regexMatrix = [NSRegularExpression regularExpressionWithPattern:patternMatrix
50 | options:NSRegularExpressionCaseInsensitive
51 | error:®exError];
52 |
53 | if(!regexError) {
54 | NSArray* matches = [regexMatrix matchesInString:str
55 | options:NSMatchingWithoutAnchoringBounds
56 | range:range];
57 | if([matches count] > 0) {
58 | // We have a match, lets parse the points
59 | NSTextCheckingResult *entry = matches[0];
60 | NSString *parameters = [str substringWithRange:[entry rangeAtIndex:1]];
61 | NSArray* coordinates = [FSSVGUtils parsePoints:[parameters UTF8String]];
62 |
63 | if([coordinates count] == 6) {
64 | // We need a 3x3 matrix
65 | tranform = CGAffineTransformMake([coordinates[0] floatValue], [coordinates[1] floatValue], [coordinates[2] floatValue], [coordinates[3] floatValue], [coordinates[4] floatValue], [coordinates[5] floatValue]);
66 | }
67 | }
68 | }
69 |
70 | return tranform;
71 | }
72 |
73 | + (CGAffineTransform)parseTranslate:(NSString*)str
74 | {
75 | CGAffineTransform tranform = CGAffineTransformIdentity;
76 | NSRange range = NSMakeRange(0, [str length]);
77 | NSString* patternTranslate = @"translate\\((.*)\\)";
78 | NSError* regexError = nil;
79 |
80 | NSRegularExpression* regexTranslate = [NSRegularExpression regularExpressionWithPattern:patternTranslate
81 | options:NSRegularExpressionCaseInsensitive
82 | error:®exError];
83 |
84 | if(!regexError) {
85 | NSArray* matches = [regexTranslate matchesInString:str
86 | options:NSMatchingWithoutAnchoringBounds
87 | range:range];
88 | if([matches count] > 0) {
89 | // We have a match, lets parse the points
90 | NSTextCheckingResult *entry = matches[0];
91 | NSString *parameters = [str substringWithRange:[entry rangeAtIndex:1]];
92 | NSArray* coordinates = [FSSVGUtils parsePoints:[parameters UTF8String]];
93 |
94 | if([coordinates count] == 2) {
95 | tranform = CGAffineTransformMakeTranslation([coordinates[0] floatValue], [coordinates[1] floatValue]);
96 | }
97 | }
98 | }
99 |
100 | return tranform;
101 | }
102 |
103 | @end
104 |
--------------------------------------------------------------------------------
/Tests/FSInteractiveMapTests/FSSVGParsingTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVGParsingTests.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 23/01/2016.
6 | // Copyright © 2016 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "FSSVGUtils.h"
11 | #import "FSSVGPathElement.h"
12 |
13 | static const float FSSVGAccuryForTest = 0.001f;
14 |
15 | @interface FSSVGParsingTests : XCTestCase
16 |
17 | @end
18 |
19 | @implementation FSSVGParsingTests
20 |
21 | - (void)setUp {
22 | [super setUp];
23 | }
24 |
25 | - (void)tearDown {
26 | // Put teardown code here. This method is called after the invocation of each test method in the class.
27 | [super tearDown];
28 | }
29 |
30 | #pragma mark - Testing the parsePoints method
31 |
32 | - (void)testEmptyPointsListParsing {
33 | NSArray* points = [FSSVGUtils parsePoints:""];
34 | XCTAssertEqual([points count], 0);
35 | }
36 |
37 | - (void)testSinglePointParsing {
38 | NSArray* points = [FSSVGUtils parsePoints:"1.2345"];
39 | XCTAssertEqual([points count], 1);
40 | XCTAssertEqualWithAccuracy([points[0] floatValue], 1.2345f, FSSVGAccuryForTest);
41 | }
42 |
43 | - (void)testMultiplePointsParsing {
44 | NSArray* points = [FSSVGUtils parsePoints:"1.2345, 2.345, 8,\n 0.001"];
45 | XCTAssertEqual([points count], 4);
46 | XCTAssertEqualWithAccuracy([points[0] floatValue], 1.2345f, FSSVGAccuryForTest);
47 | XCTAssertEqualWithAccuracy([points[1] floatValue], 2.345f, FSSVGAccuryForTest);
48 | XCTAssertEqualWithAccuracy([points[2] floatValue], 8, FSSVGAccuryForTest);
49 | XCTAssertEqualWithAccuracy([points[3] floatValue], 0.001, FSSVGAccuryForTest);
50 | }
51 |
52 | - (void)testWrongFormat {
53 | NSArray* points = [FSSVGUtils parsePoints:"abcd"];
54 | XCTAssertEqual([points count], 0);
55 | }
56 |
57 | #pragma mark - Testing the transfor parsing method
58 |
59 | - (void)testEmptyTransform {
60 | CGAffineTransform transform = [FSSVGUtils parseTransform:@""];
61 |
62 | XCTAssertEqual(transform.tx, 0);
63 | XCTAssertEqual(transform.ty, 0);
64 | XCTAssertEqual(transform.a, 1);
65 | XCTAssertEqual(transform.b, 0);
66 | XCTAssertEqual(transform.c, 0);
67 | XCTAssertEqual(transform.d, 1);
68 | }
69 |
70 | - (void)testTranslateTransform {
71 | CGAffineTransform transform = [FSSVGUtils parseTransform:@"translate(1, 2)"];
72 |
73 | XCTAssertEqual(transform.tx, 1);
74 | XCTAssertEqual(transform.ty, 2);
75 | XCTAssertEqual(transform.a, 1);
76 | XCTAssertEqual(transform.b, 0);
77 | XCTAssertEqual(transform.c, 0);
78 | XCTAssertEqual(transform.d, 1);
79 | }
80 |
81 | - (void)testMatrixTransform {
82 | CGAffineTransform transform = [FSSVGUtils parseTransform:@"matrix(1, 2, 3, 4, 5, 6)"];
83 |
84 | XCTAssertEqual(transform.a, 1);
85 | XCTAssertEqual(transform.b, 2);
86 | XCTAssertEqual(transform.c, 3);
87 | XCTAssertEqual(transform.d, 4);
88 | XCTAssertEqual(transform.tx, 5);
89 | XCTAssertEqual(transform.ty, 6);
90 | }
91 |
92 | #pragma mark - SVGPathElement testing
93 |
94 | - (void)testSvgPathElementInit {
95 | NSDictionary* dict = @{
96 | @"title" : @"title__01",
97 | @"id" : @"part_1",
98 | @"class" : @"land",
99 | @"d" : @"M302.37,434.36l-0.06,-1.12l1.61,-0.37l0.59,0.1l-0.11,2.11l-2.34,0.31l-0.5,-0.25L302.37,434.36zM309.41,631.56l-2.38,-1.12l-3.36,2.7l1.4,2.05l2.38,-2.05l1.26,1.59l3.79,-1.36l0.84,-1.58l-2.24,-2.01L309.41,631.56zM377.41,482.2l-0.95,-3.57l-1.02,-0.88l-2.4,-0.11l-2.16,-0.81l-3.58,-3.13l-4.15,-2.31l-4.19,0.11l-5.46,-1.47l-3.26,0.86l0.46,-1.54l-1.37,-1.63l-4.66,-1.7l-3.53,-1l-2.13,1.83l-0.1,-2.79l-4.96,-0.44l-0.87,-0.84l2.11,-2.29l-0.08,-1.92l-1.5,-0.46l-1.57,-4.88l-0.69,-1.54l-0.96,0.13l-0.46,-1.14l-2.97,-2.36l-2.06,-0.66l-0.95,-0.31l-3.01,-0.75l-2.27,0.2l-0.3,0.5l-3.36,-0.56l-1.11,-0.98l-1.5,-1.37l-1.06,-0.07l-0.08,-1.45l-1.73,-1.83L307.7,440l-1.1,-0.66l-1.46,0.06l-0.45,-2.26l-2.13,-1.39l-2.24,-0.21l-0.96,-1.34l2.38,-0.84l-3.36,0.04l-3.47,0.17l-0.03,0.71l-1.57,0.88l-2.14,-0.35l-1.61,-1.27l-3,0.29l-2.52,-0.02l-0.11,-0.94l-1.82,-1.58l-1.97,-0.05l-1.01,-2l-0.98,0.9l0.39,1.34l-3.49,1.15l0.14,2.15l0.87,1l-0.63,2.04l-1.21,0.18l-1.06,-2.24l1.24,-1.64l0.03,-1.48l-0.91,-1.29l1.65,-0.33l0.08,-0.67l0.54,-0.96l-0.74,-0.75l-0"
100 | };
101 |
102 | FSSVGPathElement* element = [[FSSVGPathElement alloc] initWithAttributes:dict];
103 |
104 | XCTAssertNotNil(element);
105 | XCTAssertEqual(element.title, @"title__01");
106 | XCTAssertEqual(element.identifier, @"part_1");
107 | XCTAssertEqual(element.className, @"land");
108 | XCTAssertNotNil(element.path);
109 | }
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/DetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 28/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "DetailViewController.h"
10 | #import "FSInteractiveMapView.h"
11 |
12 | @interface DetailViewController ()
13 |
14 | @property (nonatomic, weak) CAShapeLayer* oldClickedLayer;
15 | @property (nonatomic, strong) FSInteractiveMapView *map;
16 | @property (nonatomic, strong) NSDictionary *data;
17 | @property (nonatomic, strong) NSArray *colors;
18 |
19 | @end
20 |
21 | @implementation DetailViewController
22 |
23 | #pragma mark - Managing the detail item
24 |
25 | - (void)setDetailItem:(id)newDetailItem
26 | {
27 | if (_detailItem != newDetailItem) {
28 | _detailItem = newDetailItem;
29 |
30 | // Update the view.
31 | [self configureView];
32 | }
33 | }
34 |
35 | - (void)configureView
36 | {
37 | // Update the user interface for the detail item.
38 | if (self.detailItem) {
39 | self.title = self.detailItem;
40 | self.detailDescriptionLabel.text = @"";
41 | }
42 |
43 | if (@available(iOS 13.0, *)) {
44 | self.view.backgroundColor = [UIColor systemBackgroundColor];
45 | }
46 | }
47 |
48 | - (void)viewDidLoad
49 | {
50 | [super viewDidLoad];
51 | // Do any additional setup after loading the view, typically from a nib.
52 | [self configureView];
53 |
54 | if([self.detailItem isEqualToString:@"Example 1"]) {
55 | [self initExample1];
56 | } else if([self.detailItem isEqualToString:@"Example 2"]) {
57 | [self initExample2];
58 | } else if([self.detailItem isEqualToString:@"Example 3"]) {
59 | [self initExample3];
60 | } else if([self.detailItem isEqualToString:@"Example 4"]) {
61 | [self initExample4];
62 | }
63 | }
64 |
65 | - (void)viewDidAppear:(BOOL)animated
66 | {
67 | }
68 |
69 | - (void)didReceiveMemoryWarning {
70 | [super didReceiveMemoryWarning];
71 | // Dispose of any resources that can be recreated.
72 | }
73 |
74 | #pragma mark - Examples
75 |
76 | - (void)initExample1
77 | {
78 | _data = @{ @"asia" : @12,
79 | @"australia" : @2,
80 | @"north_america" : @5,
81 | @"south_america" : @14,
82 | @"africa" : @5,
83 | @"europe" : @20 };
84 |
85 | _map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(16, 96, self.view.frame.size.width - 32, self.view.frame.size.height)];
86 |
87 | [_map loadMap:@"world-continents-low" withData:_data colorAxis:@[[UIColor lightGrayColor], [UIColor darkGrayColor]]];
88 |
89 | __weak typeof(self) weakSelf = self;
90 | [_map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
91 | weakSelf.detailDescriptionLabel.text = [NSString stringWithFormat:@"Continent clicked: %@", identifier];
92 | }];
93 |
94 | [self.view addSubview:_map];
95 | }
96 |
97 | - (void)initExample2
98 | {
99 | _data = @{ @"fr" : @12,
100 | @"it" : @2,
101 | @"de" : @9,
102 | @"pl" : @24,
103 | @"uk" : @17 };
104 | _colors = @[[UIColor blueColor], [UIColor greenColor], [UIColor yellowColor], [UIColor redColor]];
105 |
106 | _map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(-1, 64, self.view.frame.size.width + 2, 500)];
107 | [self example2BasicColors];
108 | [_map loadMap:@"europe" withData:_data colorAxis:_colors];
109 |
110 | [self.view addSubview:_map];
111 | }
112 |
113 | - (void)initExample3
114 | {
115 | _map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(16, 96, self.view.frame.size.width - 32, 500)];
116 | [_map loadMap:@"usa-low" withColors:nil];
117 |
118 | __weak typeof(self) weakSelf = self;
119 | [_map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
120 | __strong typeof(weakSelf) strongSelf = weakSelf;
121 | if(strongSelf.oldClickedLayer) {
122 | strongSelf.oldClickedLayer.zPosition = 0;
123 | strongSelf.oldClickedLayer.shadowOpacity = 0;
124 | }
125 |
126 | strongSelf.oldClickedLayer = layer;
127 |
128 | // We set a simple effect on the layer clicked to highlight it
129 | layer.zPosition = 10;
130 | layer.shadowOpacity = 0.5;
131 | layer.shadowColor = [UIColor blackColor].CGColor;
132 | layer.shadowRadius = 5;
133 | layer.shadowOffset = CGSizeMake(0, 0);
134 | }];
135 |
136 | [self.view addSubview:_map];
137 | }
138 |
139 | - (void)initExample4
140 | {
141 | _data = @{ @"fr" : @12 };
142 |
143 | _map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(-1, 64, self.view.frame.size.width + 2, 500)];
144 | [_map loadMap:@"europe" withData:_data colorAxis:@[[UIColor blueColor], [UIColor greenColor], [UIColor yellowColor], [UIColor redColor]]];
145 |
146 | [self.view addSubview:_map];
147 | }
148 |
149 | - (void)example2BasicColors
150 | {
151 | if (@available(iOS 13.0, *)) {
152 | self.map.fillColor = [UIColor systemGray5Color];
153 | self.map.strokeColor = [UIColor systemBackgroundColor];
154 | self.map.backgroundColor = self.map.strokeColor;
155 | }
156 | }
157 |
158 | - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
159 | {
160 | [super traitCollectionDidChange:previousTraitCollection];
161 |
162 | if([self.detailItem isEqualToString:@"Example 2"]) {
163 | if (@available(iOS 13.0, *)) {
164 | [self example2BasicColors];
165 | [_map setData:_data colorAxis:_colors];
166 | }
167 | }
168 | }
169 |
170 | @end
171 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSInteractiveMapView.m:
--------------------------------------------------------------------------------
1 | //
2 | // FSInteractiveMapView.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 23/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "FSInteractiveMapView.h"
10 | #import "FSSVG.h"
11 | #include
12 |
13 | @interface FSInteractiveMapView ()
14 |
15 | @property (nonatomic, strong) FSSVG* svg;
16 | @property (nonatomic, strong) NSMutableArray* scaledPaths;
17 |
18 | @end
19 |
20 | @implementation FSInteractiveMapView
21 |
22 | - (id)initWithFrame:(CGRect)frame
23 | {
24 | self = [super initWithFrame:frame];
25 |
26 | if(self) {
27 | _scaledPaths = [NSMutableArray array];
28 | [self setDefaultParameters];
29 | }
30 |
31 | return self;
32 | }
33 |
34 | - (void)setDefaultParameters
35 | {
36 | self.fillColor = [UIColor colorWithWhite:0.85 alpha:1];
37 | self.strokeColor = [UIColor colorWithWhite:0.6 alpha:1];
38 | }
39 |
40 | #pragma mark - SVG map loading
41 |
42 | - (void)loadMap:(NSString*)mapName withColors:(NSDictionary*)colorsDict
43 | {
44 | _svg = [FSSVG svgWithFile:mapName];
45 |
46 | for (FSSVGPathElement* path in _svg.paths) {
47 | // Make the map fits inside the frame
48 | float scaleHorizontal = self.frame.size.width / _svg.bounds.size.width;
49 | float scaleVertical = self.frame.size.height / _svg.bounds.size.height;
50 | float scale = MIN(scaleHorizontal, scaleVertical);
51 |
52 | CGAffineTransform scaleTransform = CGAffineTransformIdentity;
53 | scaleTransform = CGAffineTransformMakeScale(scale, scale);
54 | scaleTransform = CGAffineTransformTranslate(scaleTransform,-_svg.bounds.origin.x, -_svg.bounds.origin.y);
55 |
56 | UIBezierPath* scaled = [path.path copy];
57 | [scaled applyTransform:scaleTransform];
58 |
59 | CAShapeLayer *shapeLayer = [CAShapeLayer layer];
60 | shapeLayer.path = scaled.CGPath;
61 |
62 | // Setting CAShapeLayer properties
63 | shapeLayer.strokeColor = self.strokeColor.CGColor;
64 | shapeLayer.lineWidth = 0.5;
65 |
66 | if(path.fill) {
67 | if(colorsDict && [colorsDict objectForKey:path.identifier]) {
68 | UIColor* color = [colorsDict objectForKey:path.identifier];
69 | shapeLayer.fillColor = color.CGColor;
70 | } else {
71 | shapeLayer.fillColor = self.fillColor.CGColor;
72 | }
73 |
74 | } else {
75 | shapeLayer.fillColor = [[UIColor clearColor] CGColor];
76 | }
77 |
78 | [self.layer addSublayer:shapeLayer];
79 |
80 | [_scaledPaths addObject:scaled];
81 | }
82 | }
83 |
84 | - (void)loadMap:(NSString*)mapName withData:(NSDictionary*)data colorAxis:(NSArray*)colors
85 | {
86 | [self loadMap:mapName withColors:[self getColorsForData:data colorAxis:colors]];
87 | }
88 |
89 | - (NSDictionary*)getColorsForData:(NSDictionary*)data colorAxis:(NSArray*)colors
90 | {
91 | NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:[data count]];
92 |
93 | float min = MAXFLOAT;
94 | float max = -MAXFLOAT;
95 |
96 | for (id key in data) {
97 | NSNumber* value = [data objectForKey:key];
98 |
99 | if([value floatValue] > max)
100 | max = [value floatValue];
101 |
102 | if([value floatValue] < min)
103 | min = [value floatValue];
104 | }
105 |
106 | for (id key in data) {
107 | NSNumber* value = [data objectForKey:key];
108 | float s = ([value floatValue] - min) / (max - min);
109 | s = isnan(s) ? 0 : s;
110 | float segmentLength = 1.0 / ([colors count] - 1);
111 | segmentLength = isnan(segmentLength) ? 0 : segmentLength;
112 | int minColorIndex = MAX(floorf(s / segmentLength),0);
113 | int maxColorIndex = MIN(ceilf(s / segmentLength), [colors count] - 1);
114 |
115 | UIColor* minColor = colors[minColorIndex];
116 | UIColor* maxColor = colors[maxColorIndex];
117 |
118 | s -= segmentLength * minColorIndex;
119 |
120 | CGFloat maxColorRed = 0;
121 | CGFloat maxColorGreen = 0;
122 | CGFloat maxColorBlue = 0;
123 | CGFloat minColorRed = 0;
124 | CGFloat minColorGreen = 0;
125 | CGFloat minColorBlue = 0;
126 |
127 | [maxColor getRed:&maxColorRed green:&maxColorGreen blue:&maxColorBlue alpha:nil];
128 | [minColor getRed:&minColorRed green:&minColorGreen blue:&minColorBlue alpha:nil];
129 |
130 | UIColor* color = [UIColor colorWithRed:minColorRed * (1.0 - s) + maxColorRed * s
131 | green:minColorGreen * (1.0 - s) + maxColorGreen * s
132 | blue:minColorBlue * (1.0 - s) + maxColorBlue * s
133 | alpha:1];
134 |
135 | [dict setObject:color forKey:key];
136 | }
137 |
138 | return dict;
139 | }
140 |
141 | #pragma mark - Updating the colors and/or the data
142 |
143 | - (void)setColors:(NSDictionary*)colorsDict
144 | {
145 | for(int i=0;i<[_scaledPaths count];i++) {
146 | FSSVGPathElement* element = _svg.paths[i];
147 |
148 | if([self.layer.sublayers[i] isKindOfClass:CAShapeLayer.class] && element.fill) {
149 | CAShapeLayer* l = (CAShapeLayer*)self.layer.sublayers[i];
150 | l.strokeColor = self.strokeColor.CGColor;
151 |
152 | if(element.fill) {
153 | if(colorsDict && [colorsDict objectForKey:element.identifier]) {
154 | UIColor* color = [colorsDict objectForKey:element.identifier];
155 | l.fillColor = color.CGColor;
156 | } else {
157 | l.fillColor = self.fillColor.CGColor;
158 | }
159 | } else {
160 | l.fillColor = [[UIColor clearColor] CGColor];
161 | }
162 | }
163 | }
164 | }
165 |
166 | - (void)setData:(NSDictionary*)data colorAxis:(NSArray*)colors
167 | {
168 | [self setColors:[self getColorsForData:data colorAxis:colors]];
169 | }
170 |
171 | #pragma mark - Layers enumeration
172 |
173 | - (void)enumerateLayersUsingBlock:(void (^)(NSString *, CAShapeLayer *))block
174 | {
175 | for(int i=0;i<[_scaledPaths count];i++) {
176 | FSSVGPathElement* element = _svg.paths[i];
177 |
178 | if([self.layer.sublayers[i] isKindOfClass:CAShapeLayer.class] && element.fill) {
179 | CAShapeLayer* l = (CAShapeLayer*)self.layer.sublayers[i];
180 | block(element.identifier, l);
181 | }
182 | }
183 | }
184 |
185 | #pragma mark - Touch handling
186 |
187 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
188 | {
189 | UITouch *touch = [touches anyObject];
190 | CGPoint touchPoint = [touch locationInView:self];
191 |
192 | for(int i=0;i<[_scaledPaths count];i++) {
193 | UIBezierPath* path = _scaledPaths[i];
194 | if ([path containsPoint:touchPoint])
195 | {
196 | FSSVGPathElement* element = _svg.paths[i];
197 |
198 | if([self.layer.sublayers[i] isKindOfClass:CAShapeLayer.class] && element.fill) {
199 | CAShapeLayer* l = (CAShapeLayer*)self.layer.sublayers[i];
200 |
201 | if(_clickHandler) {
202 | _clickHandler(element.identifier, l);
203 | }
204 | }
205 | }
206 | }
207 | }
208 |
209 | @end
210 |
--------------------------------------------------------------------------------
/Sources/FSInteractiveMap/FSSVGPathElement.m:
--------------------------------------------------------------------------------
1 | //
2 | // FSSVGPathElement.m
3 | // FSInteractiveMap
4 | //
5 | // Created by Arthur GUIBERT on 22/12/2014.
6 | // Copyright (c) 2014 Arthur GUIBERT. All rights reserved.
7 | //
8 |
9 | #import "FSSVGPathElement.h"
10 | #import "FSSVGUtils.h"
11 |
12 | @interface FSSVGPathElement()
13 | @property (nonatomic) CGPoint lastPoint;
14 | @end
15 |
16 | @implementation FSSVGPathElement
17 |
18 | - (instancetype)initWithAttributes:(NSDictionary *)attributes
19 | {
20 | self = [super init];
21 | if (!self)
22 | {
23 | return nil;
24 | }
25 |
26 | _lastPoint.x = _lastPoint.y = 0;
27 | self.fill = NO;
28 | self.title = [attributes objectForKey:@"title"];
29 | self.identifier = [attributes objectForKey:@"id"];
30 | self.className = [attributes objectForKey:@"class"];
31 | self.tranform = [attributes objectForKey:@"transform"];
32 | self.path = nil;
33 | [self parsePathData:[attributes objectForKey:@"d"]];
34 | [FSSVGUtils parseTransform:self.tranform];
35 |
36 | // Check the fill attribute
37 | if([attributes objectForKey:@"fill"] && [[attributes objectForKey:@"fill"] isEqualToString:@"none"]) {
38 | self.fill = NO;
39 | }
40 |
41 | return self;
42 | }
43 |
44 | - (void)parsePathData:(NSString*)pathData
45 | {
46 | if(!pathData || [pathData length] == 0)
47 | return;
48 |
49 | self.path = [UIBezierPath bezierPath];
50 |
51 | // Old-schoold C parsing as it's simpler and has a lower overhead
52 | unsigned long dataLength = [pathData length];
53 | const char* p = [[pathData dataUsingEncoding:NSASCIIStringEncoding] bytes];
54 |
55 | // The value can't be longer than the path data
56 | char* value = malloc(dataLength * sizeof(char));
57 | unsigned int valueIndex = 0;
58 |
59 | char currentCommand = 0;
60 |
61 | for(int i=0;i 0)
67 | [self executeCommand:currentCommand forValue:value];
68 | valueIndex = 0;
69 | currentCommand = p[i];
70 | continue;
71 | }
72 |
73 | value[valueIndex++] = p[i];
74 | }
75 |
76 | value[valueIndex] = '\0';
77 | [self executeCommand:currentCommand forValue:value];
78 |
79 | free(value);
80 | }
81 |
82 | - (void)executeCommand:(char)command forValue:(const char*)value
83 | {
84 | NSArray* coordinates = [FSSVGUtils parsePoints:value];
85 |
86 | if([coordinates count] == 0 && command != 'z' && command != 'Z')
87 | return;
88 |
89 | switch (command) {
90 | case 'M':
91 | [self executeMoveTo:coordinates absolute:YES];
92 | break;
93 | case 'm':
94 | [self executeMoveTo:coordinates absolute:NO];
95 | break;
96 |
97 | case 'L':
98 | [self executeLineTo:coordinates absolute:YES];
99 | break;
100 |
101 | case 'l':
102 | [self executeLineTo:coordinates absolute:NO];
103 | break;
104 |
105 | case 'H':
106 | [self executeHorizontalLineTo:coordinates absolute:YES];
107 | break;
108 |
109 | case 'h':
110 | [self executeHorizontalLineTo:coordinates absolute:NO];
111 | break;
112 |
113 | case 'V':
114 | [self executeVerticalLineTo:coordinates absolute:YES];
115 | break;
116 |
117 | case 'v':
118 | [self executeVerticalLineTo:coordinates absolute:NO];
119 | break;
120 |
121 | case 'c':
122 | [self executeCurveTo:coordinates absolute:NO];
123 | break;
124 |
125 | case 'C':
126 | [self executeCurveTo:coordinates absolute:YES];
127 | break;
128 |
129 | case 'Z':
130 | case 'z':
131 | [_path closePath];
132 | self.fill = YES;
133 | break;
134 |
135 | default:
136 | NSLog(@"Warning: Unknown command %c",command);
137 | break;
138 | }
139 |
140 | }
141 |
142 | - (void)executeMoveTo:(NSArray*)coordinates absolute:(BOOL)isAbsolute
143 | {
144 | for(int i=0;i<[coordinates count] / 2;i++) {
145 | CGPoint p;
146 |
147 | // Bounds checking
148 | if(i * 2 + 2 > [coordinates count])
149 | return;
150 |
151 | p.x = [coordinates[i * 2] floatValue];
152 | p.y = [coordinates[i * 2 + 1] floatValue];
153 |
154 | if(isAbsolute)
155 | _lastPoint = p;
156 | else
157 | _lastPoint = CGPointMake(p.x + _lastPoint.x, p.y + _lastPoint.y);
158 |
159 | [_path moveToPoint:_lastPoint];
160 | }
161 | }
162 |
163 | - (void)executeLineTo:(NSArray*)coordinates absolute:(BOOL)isAbsolute
164 | {
165 | for(int i=0;i<[coordinates count] / 2;i++) {
166 | CGPoint p;
167 |
168 | // Bounds checking
169 | if(i * 2 + 2 > [coordinates count])
170 | return;
171 |
172 | p.x = [coordinates[i * 2] floatValue];
173 | p.y = [coordinates[i * 2 + 1] floatValue];
174 |
175 | if(isAbsolute)
176 | _lastPoint = p;
177 | else
178 | _lastPoint = CGPointMake(p.x + _lastPoint.x, p.y + _lastPoint.y);
179 |
180 | [_path addLineToPoint:_lastPoint];
181 | }
182 | }
183 |
184 | - (void)executeHorizontalLineTo:(NSArray*)coordinates absolute:(BOOL)isAbsolute
185 | {
186 | for(int i=0;i<[coordinates count];i++) {
187 |
188 | // Bounds checking
189 | if(i + 1 > [coordinates count])
190 | return;
191 |
192 | float value = [coordinates[i * 2] floatValue];
193 |
194 | if(isAbsolute)
195 | _lastPoint.x = value;
196 | else
197 | _lastPoint = CGPointMake(value + _lastPoint.x, _lastPoint.y);
198 |
199 |
200 | [_path addLineToPoint:_lastPoint];
201 | }
202 | }
203 |
204 | - (void)executeVerticalLineTo:(NSArray*)coordinates absolute:(BOOL)isAbsolute
205 | {
206 | for(int i=0;i<[coordinates count];i++) {
207 |
208 | // Bounds checking
209 | if(i + 1 > [coordinates count])
210 | return;
211 |
212 | float value = [coordinates[i * 2] floatValue];
213 |
214 | if(isAbsolute)
215 | _lastPoint.y = value;
216 | else
217 | _lastPoint = CGPointMake(_lastPoint.x, value + _lastPoint.y);
218 |
219 |
220 | [_path addLineToPoint:_lastPoint];
221 | }
222 | }
223 |
224 | - (void)executeCurveTo:(NSArray*)coordinates absolute:(BOOL)isAbsolute
225 | {
226 | for(int i=0;i<[coordinates count] / 6;i++) {
227 | CGPoint c1,c2,p;
228 |
229 | // Bounds checking
230 | if(i * 6 + 6 > [coordinates count])
231 | return;
232 |
233 | c1.x = [coordinates[i * 6] floatValue];
234 | c1.y = [coordinates[i * 6 + 1] floatValue];
235 |
236 | c2.x = [coordinates[i * 6 + 2] floatValue];
237 | c2.y = [coordinates[i * 6 + 3] floatValue];
238 |
239 | p.x = [coordinates[i * 6 + 4] floatValue];
240 | p.y = [coordinates[i * 6 + 5] floatValue];
241 |
242 | if(isAbsolute) {
243 | _lastPoint = CGPointMake(p.x, p.y);
244 | [_path addCurveToPoint:_lastPoint
245 | controlPoint1:CGPointMake(c1.x, c1.y)
246 | controlPoint2:CGPointMake(c2.x, c2.y)];
247 | } else {
248 | [_path addCurveToPoint:CGPointMake(_lastPoint.x + p.x, _lastPoint.y + p.y)
249 | controlPoint1:CGPointMake(_lastPoint.x + c1.x, _lastPoint.y + c1.y)
250 | controlPoint2:CGPointMake(_lastPoint.x + c2.x, _lastPoint.y + c2.y)];
251 |
252 | _lastPoint = CGPointMake(_lastPoint.x + p.x, _lastPoint.y + p.y);
253 | }
254 |
255 | }
256 | }
257 |
258 | @end
259 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/FSInteractiveMap/Data/austria-low.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/FSInteractiveMap.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0C3F754A2C2F2BE2008F190C /* FSSVGUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3F75452C2F2BE2008F190C /* FSSVGUtils.m */; };
11 | 0C3F754B2C2F2BE2008F190C /* FSSVG.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3F75462C2F2BE2008F190C /* FSSVG.m */; };
12 | 0C3F754C2C2F2BE2008F190C /* FSSVGPathElement.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3F75492C2F2BE2008F190C /* FSSVGPathElement.m */; };
13 | 8ED756AE1A5095A80073A6A2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED756AD1A5095A80073A6A2 /* main.m */; };
14 | 8ED756B11A5095A80073A6A2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED756B01A5095A80073A6A2 /* AppDelegate.m */; };
15 | 8ED756B41A5095A80073A6A2 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED756B31A5095A80073A6A2 /* MasterViewController.m */; };
16 | 8ED756B71A5095A80073A6A2 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED756B61A5095A80073A6A2 /* DetailViewController.m */; };
17 | 8ED756BA1A5095A80073A6A2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756B81A5095A80073A6A2 /* Main.storyboard */; };
18 | 8ED756BC1A5095A80073A6A2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756BB1A5095A80073A6A2 /* Images.xcassets */; };
19 | 8ED756BF1A5095A80073A6A2 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756BD1A5095A80073A6A2 /* LaunchScreen.xib */; };
20 | 8ED756EB1A5099480073A6A2 /* austria-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756D61A5099480073A6A2 /* austria-low.svg */; };
21 | 8ED756EC1A5099480073A6A2 /* beef-cuts.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756D71A5099480073A6A2 /* beef-cuts.svg */; };
22 | 8ED756ED1A5099480073A6A2 /* china-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756D81A5099480073A6A2 /* china-low.svg */; };
23 | 8ED756EE1A5099480073A6A2 /* europe.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756D91A5099480073A6A2 /* europe.svg */; };
24 | 8ED756EF1A5099480073A6A2 /* france-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DA1A5099480073A6A2 /* france-low.svg */; };
25 | 8ED756F01A5099480073A6A2 /* germany.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DB1A5099480073A6A2 /* germany.svg */; };
26 | 8ED756F11A5099480073A6A2 /* india-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DC1A5099480073A6A2 /* india-low.svg */; };
27 | 8ED756F21A5099480073A6A2 /* italy.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DD1A5099480073A6A2 /* italy.svg */; };
28 | 8ED756F31A5099480073A6A2 /* uk-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DE1A5099480073A6A2 /* uk-low.svg */; };
29 | 8ED756F41A5099480073A6A2 /* usa-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756DF1A5099480073A6A2 /* usa-low.svg */; };
30 | 8ED756F51A5099480073A6A2 /* world-continents-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756E01A5099480073A6A2 /* world-continents-low.svg */; };
31 | 8ED756F61A5099480073A6A2 /* world-low.svg in Resources */ = {isa = PBXBuildFile; fileRef = 8ED756E11A5099480073A6A2 /* world-low.svg */; };
32 | 8ED756F71A5099480073A6A2 /* FSInteractiveMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8ED756E31A5099480073A6A2 /* FSInteractiveMapView.m */; };
33 | /* End PBXBuildFile section */
34 |
35 | /* Begin PBXFileReference section */
36 | 0C3F75442C2F2BE2008F190C /* FSSVGUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSSVGUtils.h; sourceTree = ""; };
37 | 0C3F75452C2F2BE2008F190C /* FSSVGUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSSVGUtils.m; sourceTree = ""; };
38 | 0C3F75462C2F2BE2008F190C /* FSSVG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSSVG.m; sourceTree = ""; };
39 | 0C3F75472C2F2BE2008F190C /* FSSVG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSSVG.h; sourceTree = ""; };
40 | 0C3F75482C2F2BE2008F190C /* FSSVGPathElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSSVGPathElement.h; sourceTree = ""; };
41 | 0C3F75492C2F2BE2008F190C /* FSSVGPathElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSSVGPathElement.m; sourceTree = ""; };
42 | 8E302F881C53EA81009A368A /* FSSVGParsingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSSVGParsingTests.m; sourceTree = ""; };
43 | 8ED756A81A5095A80073A6A2 /* FSInteractiveMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FSInteractiveMap.app; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 8ED756AC1A5095A80073A6A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 8ED756AD1A5095A80073A6A2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
46 | 8ED756AF1A5095A80073A6A2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
47 | 8ED756B01A5095A80073A6A2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
48 | 8ED756B21A5095A80073A6A2 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; };
49 | 8ED756B31A5095A80073A6A2 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; };
50 | 8ED756B51A5095A80073A6A2 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; };
51 | 8ED756B61A5095A80073A6A2 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; };
52 | 8ED756B91A5095A80073A6A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
53 | 8ED756BB1A5095A80073A6A2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
54 | 8ED756BE1A5095A80073A6A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
55 | 8ED756D61A5099480073A6A2 /* austria-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "austria-low.svg"; sourceTree = ""; };
56 | 8ED756D71A5099480073A6A2 /* beef-cuts.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "beef-cuts.svg"; sourceTree = ""; };
57 | 8ED756D81A5099480073A6A2 /* china-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "china-low.svg"; sourceTree = ""; };
58 | 8ED756D91A5099480073A6A2 /* europe.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = europe.svg; sourceTree = ""; };
59 | 8ED756DA1A5099480073A6A2 /* france-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "france-low.svg"; sourceTree = ""; };
60 | 8ED756DB1A5099480073A6A2 /* germany.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = germany.svg; sourceTree = ""; };
61 | 8ED756DC1A5099480073A6A2 /* india-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "india-low.svg"; sourceTree = ""; };
62 | 8ED756DD1A5099480073A6A2 /* italy.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = italy.svg; sourceTree = ""; };
63 | 8ED756DE1A5099480073A6A2 /* uk-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "uk-low.svg"; sourceTree = ""; };
64 | 8ED756DF1A5099480073A6A2 /* usa-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "usa-low.svg"; sourceTree = ""; };
65 | 8ED756E01A5099480073A6A2 /* world-continents-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "world-continents-low.svg"; sourceTree = ""; };
66 | 8ED756E11A5099480073A6A2 /* world-low.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "world-low.svg"; sourceTree = ""; };
67 | 8ED756E21A5099480073A6A2 /* FSInteractiveMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSInteractiveMapView.h; sourceTree = ""; };
68 | 8ED756E31A5099480073A6A2 /* FSInteractiveMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSInteractiveMapView.m; sourceTree = ""; };
69 | /* End PBXFileReference section */
70 |
71 | /* Begin PBXFrameworksBuildPhase section */
72 | 8ED756A51A5095A80073A6A2 /* Frameworks */ = {
73 | isa = PBXFrameworksBuildPhase;
74 | buildActionMask = 2147483647;
75 | files = (
76 | );
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | /* End PBXFrameworksBuildPhase section */
80 |
81 | /* Begin PBXGroup section */
82 | 0C3F753F2C2F2A17008F190C /* Sources */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 0C3F75412C2F2A25008F190C /* FSInteractiveMap */,
86 | );
87 | path = Sources;
88 | sourceTree = "";
89 | };
90 | 0C3F75402C2F2A1D008F190C /* Tests */ = {
91 | isa = PBXGroup;
92 | children = (
93 | 0C3F75422C2F2A2A008F190C /* FSInteractiveMapTests */,
94 | );
95 | path = Tests;
96 | sourceTree = "";
97 | };
98 | 0C3F75412C2F2A25008F190C /* FSInteractiveMap */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 0C3F75432C2F2B08008F190C /* include */,
102 | 8ED756E31A5099480073A6A2 /* FSInteractiveMapView.m */,
103 | 0C3F75472C2F2BE2008F190C /* FSSVG.h */,
104 | 0C3F75462C2F2BE2008F190C /* FSSVG.m */,
105 | 0C3F75482C2F2BE2008F190C /* FSSVGPathElement.h */,
106 | 0C3F75492C2F2BE2008F190C /* FSSVGPathElement.m */,
107 | 0C3F75442C2F2BE2008F190C /* FSSVGUtils.h */,
108 | 0C3F75452C2F2BE2008F190C /* FSSVGUtils.m */,
109 | );
110 | path = FSInteractiveMap;
111 | sourceTree = "";
112 | };
113 | 0C3F75422C2F2A2A008F190C /* FSInteractiveMapTests */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 8E302F881C53EA81009A368A /* FSSVGParsingTests.m */,
117 | );
118 | path = FSInteractiveMapTests;
119 | sourceTree = "";
120 | };
121 | 0C3F75432C2F2B08008F190C /* include */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 8ED756E21A5099480073A6A2 /* FSInteractiveMapView.h */,
125 | );
126 | path = include;
127 | sourceTree = "";
128 | };
129 | 8ED7569F1A5095A80073A6A2 = {
130 | isa = PBXGroup;
131 | children = (
132 | 0C3F75402C2F2A1D008F190C /* Tests */,
133 | 0C3F753F2C2F2A17008F190C /* Sources */,
134 | 8ED756AA1A5095A80073A6A2 /* FSInteractiveMapDemo */,
135 | 8ED756A91A5095A80073A6A2 /* Products */,
136 | );
137 | sourceTree = "";
138 | };
139 | 8ED756A91A5095A80073A6A2 /* Products */ = {
140 | isa = PBXGroup;
141 | children = (
142 | 8ED756A81A5095A80073A6A2 /* FSInteractiveMap.app */,
143 | );
144 | name = Products;
145 | sourceTree = "";
146 | };
147 | 8ED756AA1A5095A80073A6A2 /* FSInteractiveMapDemo */ = {
148 | isa = PBXGroup;
149 | children = (
150 | 8ED756D41A5099480073A6A2 /* FSInteractiveMap */,
151 | 8ED756AF1A5095A80073A6A2 /* AppDelegate.h */,
152 | 8ED756B01A5095A80073A6A2 /* AppDelegate.m */,
153 | 8ED756B21A5095A80073A6A2 /* MasterViewController.h */,
154 | 8ED756B31A5095A80073A6A2 /* MasterViewController.m */,
155 | 8ED756B51A5095A80073A6A2 /* DetailViewController.h */,
156 | 8ED756B61A5095A80073A6A2 /* DetailViewController.m */,
157 | 8ED756B81A5095A80073A6A2 /* Main.storyboard */,
158 | 8ED756BB1A5095A80073A6A2 /* Images.xcassets */,
159 | 8ED756BD1A5095A80073A6A2 /* LaunchScreen.xib */,
160 | 8ED756AB1A5095A80073A6A2 /* Supporting Files */,
161 | );
162 | path = FSInteractiveMapDemo;
163 | sourceTree = "";
164 | };
165 | 8ED756AB1A5095A80073A6A2 /* Supporting Files */ = {
166 | isa = PBXGroup;
167 | children = (
168 | 8ED756AC1A5095A80073A6A2 /* Info.plist */,
169 | 8ED756AD1A5095A80073A6A2 /* main.m */,
170 | );
171 | name = "Supporting Files";
172 | sourceTree = "";
173 | };
174 | 8ED756D41A5099480073A6A2 /* FSInteractiveMap */ = {
175 | isa = PBXGroup;
176 | children = (
177 | 8ED756D51A5099480073A6A2 /* Data */,
178 | );
179 | path = FSInteractiveMap;
180 | sourceTree = "";
181 | };
182 | 8ED756D51A5099480073A6A2 /* Data */ = {
183 | isa = PBXGroup;
184 | children = (
185 | 8ED756D61A5099480073A6A2 /* austria-low.svg */,
186 | 8ED756D71A5099480073A6A2 /* beef-cuts.svg */,
187 | 8ED756D81A5099480073A6A2 /* china-low.svg */,
188 | 8ED756D91A5099480073A6A2 /* europe.svg */,
189 | 8ED756DA1A5099480073A6A2 /* france-low.svg */,
190 | 8ED756DB1A5099480073A6A2 /* germany.svg */,
191 | 8ED756DC1A5099480073A6A2 /* india-low.svg */,
192 | 8ED756DD1A5099480073A6A2 /* italy.svg */,
193 | 8ED756DE1A5099480073A6A2 /* uk-low.svg */,
194 | 8ED756DF1A5099480073A6A2 /* usa-low.svg */,
195 | 8ED756E01A5099480073A6A2 /* world-continents-low.svg */,
196 | 8ED756E11A5099480073A6A2 /* world-low.svg */,
197 | );
198 | path = Data;
199 | sourceTree = "";
200 | };
201 | /* End PBXGroup section */
202 |
203 | /* Begin PBXNativeTarget section */
204 | 8ED756A71A5095A80073A6A2 /* FSInteractiveMap */ = {
205 | isa = PBXNativeTarget;
206 | buildConfigurationList = 8ED756CE1A5095A80073A6A2 /* Build configuration list for PBXNativeTarget "FSInteractiveMap" */;
207 | buildPhases = (
208 | 8ED756A41A5095A80073A6A2 /* Sources */,
209 | 8ED756A51A5095A80073A6A2 /* Frameworks */,
210 | 8ED756A61A5095A80073A6A2 /* Resources */,
211 | );
212 | buildRules = (
213 | );
214 | dependencies = (
215 | );
216 | name = FSInteractiveMap;
217 | productName = FSInteractiveMap;
218 | productReference = 8ED756A81A5095A80073A6A2 /* FSInteractiveMap.app */;
219 | productType = "com.apple.product-type.application";
220 | };
221 | /* End PBXNativeTarget section */
222 |
223 | /* Begin PBXProject section */
224 | 8ED756A01A5095A80073A6A2 /* Project object */ = {
225 | isa = PBXProject;
226 | attributes = {
227 | LastUpgradeCheck = 0720;
228 | ORGANIZATIONNAME = "Arthur GUIBERT";
229 | TargetAttributes = {
230 | 8ED756A71A5095A80073A6A2 = {
231 | CreatedOnToolsVersion = 6.1;
232 | };
233 | };
234 | };
235 | buildConfigurationList = 8ED756A31A5095A80073A6A2 /* Build configuration list for PBXProject "FSInteractiveMap" */;
236 | compatibilityVersion = "Xcode 3.2";
237 | developmentRegion = English;
238 | hasScannedForEncodings = 0;
239 | knownRegions = (
240 | English,
241 | en,
242 | Base,
243 | );
244 | mainGroup = 8ED7569F1A5095A80073A6A2;
245 | productRefGroup = 8ED756A91A5095A80073A6A2 /* Products */;
246 | projectDirPath = "";
247 | projectRoot = "";
248 | targets = (
249 | 8ED756A71A5095A80073A6A2 /* FSInteractiveMap */,
250 | );
251 | };
252 | /* End PBXProject section */
253 |
254 | /* Begin PBXResourcesBuildPhase section */
255 | 8ED756A61A5095A80073A6A2 /* Resources */ = {
256 | isa = PBXResourcesBuildPhase;
257 | buildActionMask = 2147483647;
258 | files = (
259 | 8ED756EE1A5099480073A6A2 /* europe.svg in Resources */,
260 | 8ED756EC1A5099480073A6A2 /* beef-cuts.svg in Resources */,
261 | 8ED756F61A5099480073A6A2 /* world-low.svg in Resources */,
262 | 8ED756EF1A5099480073A6A2 /* france-low.svg in Resources */,
263 | 8ED756F51A5099480073A6A2 /* world-continents-low.svg in Resources */,
264 | 8ED756F41A5099480073A6A2 /* usa-low.svg in Resources */,
265 | 8ED756F01A5099480073A6A2 /* germany.svg in Resources */,
266 | 8ED756F21A5099480073A6A2 /* italy.svg in Resources */,
267 | 8ED756ED1A5099480073A6A2 /* china-low.svg in Resources */,
268 | 8ED756BA1A5095A80073A6A2 /* Main.storyboard in Resources */,
269 | 8ED756EB1A5099480073A6A2 /* austria-low.svg in Resources */,
270 | 8ED756F11A5099480073A6A2 /* india-low.svg in Resources */,
271 | 8ED756BF1A5095A80073A6A2 /* LaunchScreen.xib in Resources */,
272 | 8ED756BC1A5095A80073A6A2 /* Images.xcassets in Resources */,
273 | 8ED756F31A5099480073A6A2 /* uk-low.svg in Resources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | /* End PBXResourcesBuildPhase section */
278 |
279 | /* Begin PBXSourcesBuildPhase section */
280 | 8ED756A41A5095A80073A6A2 /* Sources */ = {
281 | isa = PBXSourcesBuildPhase;
282 | buildActionMask = 2147483647;
283 | files = (
284 | 0C3F754B2C2F2BE2008F190C /* FSSVG.m in Sources */,
285 | 8ED756B11A5095A80073A6A2 /* AppDelegate.m in Sources */,
286 | 8ED756F71A5099480073A6A2 /* FSInteractiveMapView.m in Sources */,
287 | 8ED756B41A5095A80073A6A2 /* MasterViewController.m in Sources */,
288 | 0C3F754A2C2F2BE2008F190C /* FSSVGUtils.m in Sources */,
289 | 0C3F754C2C2F2BE2008F190C /* FSSVGPathElement.m in Sources */,
290 | 8ED756AE1A5095A80073A6A2 /* main.m in Sources */,
291 | 8ED756B71A5095A80073A6A2 /* DetailViewController.m in Sources */,
292 | );
293 | runOnlyForDeploymentPostprocessing = 0;
294 | };
295 | /* End PBXSourcesBuildPhase section */
296 |
297 | /* Begin PBXVariantGroup section */
298 | 8ED756B81A5095A80073A6A2 /* Main.storyboard */ = {
299 | isa = PBXVariantGroup;
300 | children = (
301 | 8ED756B91A5095A80073A6A2 /* Base */,
302 | );
303 | name = Main.storyboard;
304 | sourceTree = "";
305 | };
306 | 8ED756BD1A5095A80073A6A2 /* LaunchScreen.xib */ = {
307 | isa = PBXVariantGroup;
308 | children = (
309 | 8ED756BE1A5095A80073A6A2 /* Base */,
310 | );
311 | name = LaunchScreen.xib;
312 | sourceTree = "";
313 | };
314 | /* End PBXVariantGroup section */
315 |
316 | /* Begin XCBuildConfiguration section */
317 | 8ED756CC1A5095A80073A6A2 /* Debug */ = {
318 | isa = XCBuildConfiguration;
319 | buildSettings = {
320 | ALWAYS_SEARCH_USER_PATHS = NO;
321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
322 | CLANG_CXX_LIBRARY = "libc++";
323 | CLANG_ENABLE_MODULES = YES;
324 | CLANG_ENABLE_OBJC_ARC = YES;
325 | CLANG_WARN_BOOL_CONVERSION = YES;
326 | CLANG_WARN_CONSTANT_CONVERSION = YES;
327 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
328 | CLANG_WARN_EMPTY_BODY = YES;
329 | CLANG_WARN_ENUM_CONVERSION = YES;
330 | CLANG_WARN_INT_CONVERSION = YES;
331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
332 | CLANG_WARN_UNREACHABLE_CODE = YES;
333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
335 | COPY_PHASE_STRIP = NO;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | ENABLE_TESTABILITY = YES;
338 | GCC_C_LANGUAGE_STANDARD = gnu99;
339 | GCC_DYNAMIC_NO_PIC = NO;
340 | GCC_OPTIMIZATION_LEVEL = 0;
341 | GCC_PREPROCESSOR_DEFINITIONS = (
342 | "DEBUG=1",
343 | "$(inherited)",
344 | );
345 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
348 | GCC_WARN_UNDECLARED_SELECTOR = YES;
349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
350 | GCC_WARN_UNUSED_FUNCTION = YES;
351 | GCC_WARN_UNUSED_VARIABLE = YES;
352 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
353 | MTL_ENABLE_DEBUG_INFO = YES;
354 | ONLY_ACTIVE_ARCH = YES;
355 | SDKROOT = iphoneos;
356 | TARGETED_DEVICE_FAMILY = "1,2";
357 | };
358 | name = Debug;
359 | };
360 | 8ED756CD1A5095A80073A6A2 /* Release */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | ALWAYS_SEARCH_USER_PATHS = NO;
364 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
365 | CLANG_CXX_LIBRARY = "libc++";
366 | CLANG_ENABLE_MODULES = YES;
367 | CLANG_ENABLE_OBJC_ARC = YES;
368 | CLANG_WARN_BOOL_CONVERSION = YES;
369 | CLANG_WARN_CONSTANT_CONVERSION = YES;
370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
371 | CLANG_WARN_EMPTY_BODY = YES;
372 | CLANG_WARN_ENUM_CONVERSION = YES;
373 | CLANG_WARN_INT_CONVERSION = YES;
374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
375 | CLANG_WARN_UNREACHABLE_CODE = YES;
376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
378 | COPY_PHASE_STRIP = YES;
379 | ENABLE_NS_ASSERTIONS = NO;
380 | ENABLE_STRICT_OBJC_MSGSEND = YES;
381 | GCC_C_LANGUAGE_STANDARD = gnu99;
382 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
383 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
384 | GCC_WARN_UNDECLARED_SELECTOR = YES;
385 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
386 | GCC_WARN_UNUSED_FUNCTION = YES;
387 | GCC_WARN_UNUSED_VARIABLE = YES;
388 | IPHONEOS_DEPLOYMENT_TARGET = 8.1;
389 | MTL_ENABLE_DEBUG_INFO = NO;
390 | SDKROOT = iphoneos;
391 | TARGETED_DEVICE_FAMILY = "1,2";
392 | VALIDATE_PRODUCT = YES;
393 | };
394 | name = Release;
395 | };
396 | 8ED756CF1A5095A80073A6A2 /* Debug */ = {
397 | isa = XCBuildConfiguration;
398 | buildSettings = {
399 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
400 | INFOPLIST_FILE = FSInteractiveMapDemo/Info.plist;
401 | IPHONEOS_DEPLOYMENT_TARGET = 14.0;
402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
403 | PRODUCT_BUNDLE_IDENTIFIER = "com.slipcorp.$(PRODUCT_NAME:rfc1034identifier)";
404 | PRODUCT_NAME = "$(TARGET_NAME)";
405 | };
406 | name = Debug;
407 | };
408 | 8ED756D01A5095A80073A6A2 /* Release */ = {
409 | isa = XCBuildConfiguration;
410 | buildSettings = {
411 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
412 | INFOPLIST_FILE = FSInteractiveMapDemo/Info.plist;
413 | IPHONEOS_DEPLOYMENT_TARGET = 14.0;
414 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
415 | PRODUCT_BUNDLE_IDENTIFIER = "com.slipcorp.$(PRODUCT_NAME:rfc1034identifier)";
416 | PRODUCT_NAME = "$(TARGET_NAME)";
417 | };
418 | name = Release;
419 | };
420 | /* End XCBuildConfiguration section */
421 |
422 | /* Begin XCConfigurationList section */
423 | 8ED756A31A5095A80073A6A2 /* Build configuration list for PBXProject "FSInteractiveMap" */ = {
424 | isa = XCConfigurationList;
425 | buildConfigurations = (
426 | 8ED756CC1A5095A80073A6A2 /* Debug */,
427 | 8ED756CD1A5095A80073A6A2 /* Release */,
428 | );
429 | defaultConfigurationIsVisible = 0;
430 | defaultConfigurationName = Release;
431 | };
432 | 8ED756CE1A5095A80073A6A2 /* Build configuration list for PBXNativeTarget "FSInteractiveMap" */ = {
433 | isa = XCConfigurationList;
434 | buildConfigurations = (
435 | 8ED756CF1A5095A80073A6A2 /* Debug */,
436 | 8ED756D01A5095A80073A6A2 /* Release */,
437 | );
438 | defaultConfigurationIsVisible = 0;
439 | defaultConfigurationName = Release;
440 | };
441 | /* End XCConfigurationList section */
442 | };
443 | rootObject = 8ED756A01A5095A80073A6A2 /* Project object */;
444 | }
445 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/FSInteractiveMap/Data/beef-cuts.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
354 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/FSInteractiveMap/Data/usa-low.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/FSInteractiveMapDemo/FSInteractiveMap/Data/france-low.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------