Skip to content

Commit

Permalink
Merge branch 'features'
Browse files Browse the repository at this point in the history
  • Loading branch information
tyburg committed Aug 4, 2020
2 parents 58ed406 + f6764d6 commit 0346f8e
Show file tree
Hide file tree
Showing 190 changed files with 5,113 additions and 8,536 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ platform :ios, '8.0'
inhibit_all_warnings!

target 'mapcache-ios' do
pod 'geopackage-ios', '~> 3.3.0'
pod 'geopackage-ios', '~> 4.0.1'
pod 'Fingertips', '~> 0.5.0'
end
Binary file modified mapcache-ios-geopackage.sketch
Binary file not shown.
275 changes: 173 additions & 102 deletions mapcache-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,15 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0401366E1AF94FB200C92AFC"
BuildableName = "mapcache-ios.app"
BlueprintName = "mapcache-ios"
ReferencedContainer = "container:mapcache-ios.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
18 changes: 13 additions & 5 deletions mapcache-ios/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import "AppDelegate.h"
#import "GPKGGeoPackageFactory.h"
#import "GPKGSManagerViewController.h"
#import "GPKGSConstants.h"
#import "GPKGSProperties.h"
#import "MCConstants.h"
#import "MCProperties.h"
#import "MBFingerTipWindow.h"

@interface AppDelegate ()
Expand All @@ -22,7 +22,7 @@ @interface AppDelegate ()
@implementation AppDelegate

- (UIWindow *)window {
if ([GPKGSProperties getBoolOfProperty:GPKGS_ANIMATE_SCREEN_TOUCHES] && !_window) {
if ([MCProperties getBoolOfProperty:GPKGS_ANIMATE_SCREEN_TOUCHES] && !_window) {
MBFingerTipWindow * fingerTip = [[MBFingerTipWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
fingerTip.alwaysShowTouches = YES;
_window = fingerTip;
Expand Down Expand Up @@ -52,7 +52,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[_window.rootViewController presentViewController:disclaimer animated:YES completion:nil];
}

_manager = [GPKGGeoPackageFactory getManager];
_manager = [GPKGGeoPackageFactory manager];
_geoPackages = [[GPKGGeoPackageCache alloc] initWithManager:self.manager];

return YES;
Expand Down Expand Up @@ -100,9 +100,17 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction
NSString * fileUrl = [url path];

BOOL imported = false;
GPKGGeoPackageManager * manager = [GPKGGeoPackageFactory getManager];
GPKGGeoPackageManager * manager = [GPKGGeoPackageFactory manager];
@try {
imported = [manager importGeoPackageFromPath:fileUrl andOverride:true andMove:true];
} @catch (NSException *e) {
NSLog(@"------------------------- AppDelegate - Problem importing geopackage %@\n%@", fileUrl, e.reason);

UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Problem importing GeoPacakge" message:e.reason preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) {}];
[alert addAction:defaultAction];
[self.window.rootViewController presentViewController:alert animated:YES completion:nil];

}
@finally {
[manager close];
Expand Down
3,350 changes: 0 additions & 3,350 deletions mapcache-ios/Base.lproj/Main.storyboard

This file was deleted.

12 changes: 7 additions & 5 deletions mapcache-ios/Images.xcassets/Point.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"images" : [
{
"filename" : "Point_3.png",
"idiom" : "universal",
"scale" : "1x",
"filename" : "ic_point.png"
"scale" : "1x"
},
{
"filename" : "Point_4.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Point_5.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
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.
Binary file not shown.
23 changes: 23 additions & 0 deletions mapcache-ios/Images.xcassets/ZoomLevel.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "ZoomLevel.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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.
23 changes: 23 additions & 0 deletions mapcache-ios/Images.xcassets/boolean.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Boolean.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 23 additions & 0 deletions mapcache-ios/Images.xcassets/number.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Number.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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.
23 changes: 23 additions & 0 deletions mapcache-ios/Images.xcassets/text.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Text.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file added mapcache-ios/Images.xcassets/text.imageset/Text.png
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.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//

#import <Foundation/Foundation.h>
#import "GPKGSTable.h"
#import "MCTable.h"

@interface GPKGSDatabase : NSObject
@interface MCDatabase : NSObject

@property (nonatomic, strong) NSString *name;
@property (nonatomic) BOOL expanded;
Expand All @@ -36,19 +36,23 @@

-(NSInteger) getActiveTableCount;

-(void) addFeature: (GPKGSTable *) table;
-(void) addFeature: (MCTable *) table;

-(void) addFeatureOverlay: (GPKGSTable *) table;
-(void) addFeatureOverlay: (MCTable *) table;

-(void) addTile: (GPKGSTable *) table;
-(void) addTile: (MCTable *) table;

-(BOOL) exists: (GPKGSTable *) table;
-(BOOL) exists: (MCTable *) table;

- (BOOL) hasTableNamed:(NSString *)tableName;

- (MCTable *) tableNamed:(NSString *)tableName;

-(BOOL) existsWithTable: (NSString *) table ofType: (enum GPKGSTableType) tableType;

-(void) add:(GPKGSTable *) table;
-(void) add:(MCTable *) table;

-(void) remove:(GPKGSTable *) table;
-(void) remove:(MCTable *) table;

-(BOOL) isEmpty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright (c) 2015 NGA. All rights reserved.
//

#import "GPKGSDatabase.h"
#import "MCDatabase.h"

@interface GPKGSDatabase ()
@interface MCDatabase ()

@property (nonatomic, strong) NSMutableOrderedSet *featuresSet;
@property (nonatomic, strong) NSMutableOrderedSet *featureNamesSet;
Expand All @@ -19,7 +19,7 @@ @interface GPKGSDatabase ()

@end

@implementation GPKGSDatabase
@implementation MCDatabase

-(instancetype) initWithName: (NSString *) name andExpanded: (BOOL) expanded{
self = [super init];
Expand Down Expand Up @@ -54,7 +54,7 @@ -(NSInteger) getFeatureOverlayCount{

-(NSInteger) getActiveFeatureOverlayCount{
int count = 0;
for(GPKGSTable * table in self.featureOverlaysSet){
for(MCTable * table in self.featureOverlaysSet){
if(table.active){
count++;
}
Expand All @@ -73,7 +73,7 @@ -(NSInteger) getTileCount{
- (NSInteger) activeTileTableCount {
NSInteger activeCount = 0;
if ([self.tilesSet count] > 0) {
for (GPKGSTable *table in self.tilesSet.array) {
for (MCTable *table in self.tilesSet.array) {
if (table.active) {
activeCount++;
}
Expand All @@ -86,7 +86,7 @@ - (NSInteger) activeTileTableCount {
- (NSInteger) activeFeatureTableCount {
NSInteger activeCount = 0;
if ([self.featuresSet count] > 0) {
for (GPKGSTable *table in self.tilesSet.array) {
for (MCTable *table in self.tilesSet.array) {
if (table.active) {
activeCount++;
}
Expand All @@ -112,49 +112,72 @@ -(NSInteger) getActiveTableCount{
return [self getFeatureCount] + [self getTileCount] + [self getActiveFeatureOverlayCount];
}

-(void) addFeature: (GPKGSTable *) table{
-(void) addFeature: (MCTable *) table{
[self.featuresSet addObject:table];
[self.featureNamesSet addObject:table.name];
}

-(void) addFeatureOverlay: (GPKGSTable *) table{
-(void) addFeatureOverlay: (MCTable *) table{
[self.featureOverlaysSet addObject:table];
[self.featureOverlayNamesSet addObject:table.name];
}

-(void) addTile: (GPKGSTable *) table{
-(void) addTile: (MCTable *) table{
[self.tilesSet addObject:table];
[self.tileNamesSet addObject:table.name];
}

-(void) removeFeature: (GPKGSTable *) table{
-(void) removeFeature: (MCTable *) table{
NSUInteger index = [self.featureNamesSet indexOfObject:table.name];
if(index != NSNotFound){
[self.featuresSet removeObjectAtIndex:index];
[self.featureNamesSet removeObjectAtIndex:index];
}
}

-(void) removeFeatureOverlay: (GPKGSTable *) table{
-(void) removeFeatureOverlay: (MCTable *) table{
NSUInteger index = [self.featureOverlayNamesSet indexOfObject:table.name];
if(index != NSNotFound){
[self.featureOverlaysSet removeObjectAtIndex:index];
[self.featureOverlayNamesSet removeObjectAtIndex:index];
}
}

-(void) removeTile: (GPKGSTable *) table{
-(void) removeTile: (MCTable *) table{
NSUInteger index = [self.tileNamesSet indexOfObject:table.name];
if(index != NSNotFound){
[self.tilesSet removeObjectAtIndex:index];
[self.tileNamesSet removeObjectAtIndex:index];
}
}

-(BOOL) exists: (GPKGSTable *) table{
-(BOOL) exists: (MCTable *) table{
return [self existsWithTable:table.name ofType:[table getType]];
}


- (BOOL) hasTableNamed: (NSString *) tableName {
for (MCTable* table in [self getTables]) {
if ([table.name isEqualToString:tableName]) {
return YES;
}
}

return NO;
}


- (MCTable *) tableNamed:(NSString *)tableName {
for (MCTable* table in [self getTables]) {
if ([table.name isEqualToString:tableName]) {
return table;
}
}

return nil;
}


-(BOOL) existsWithTable: (NSString *) table ofType: (enum GPKGSTableType) tableType{

BOOL exists = false;
Expand All @@ -176,7 +199,7 @@ -(BOOL) existsWithTable: (NSString *) table ofType: (enum GPKGSTableType) tableT
return exists;
}

-(void) add:(GPKGSTable *) table{
-(void) add:(MCTable *) table{
switch([table getType]){
case GPKGS_TT_FEATURE:
[self addFeature:table];
Expand All @@ -192,7 +215,7 @@ -(void) add:(GPKGSTable *) table{
}
}

-(void) remove:(GPKGSTable *) table{
-(void) remove:(MCTable *) table{
switch([table getType]){
case GPKGS_TT_FEATURE:
[self removeFeature:table];
Expand Down
Loading

0 comments on commit 0346f8e

Please sign in to comment.