Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

map moves to current location on button press

  • Loading branch information...
commit 9ac5ef2b5006ecdb811be84bc55c89a3b4957baf 1 parent ca92700
@davidchiles authored
View
4 OSM POI Editor.xcodeproj/project.pbxproj
@@ -76,6 +76,7 @@
63E4BF3114E0728200E0BD46 /* NSDataAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF2E14E0728200E0BD46 /* NSDataAdditions.m */; };
63E4BF3214E0728200E0BD46 /* TBXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF3014E0728200E0BD46 /* TBXML.m */; };
63E5B13614EDAF2E007E9BAF /* location.png in Resources */ = {isa = PBXBuildFile; fileRef = 63E5B13514EDAF2E007E9BAF /* location.png */; };
+ 63F9CCA514F32B2E00308DE1 /* iphone_delete_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */; };
63FFDC6614E480DF00701DEC /* OPETagInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */; };
/* End PBXBuildFile section */
@@ -323,6 +324,7 @@
63E4BF2F14E0728200E0BD46 /* TBXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBXML.h; sourceTree = "<group>"; };
63E4BF3014E0728200E0BD46 /* TBXML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBXML.m; sourceTree = "<group>"; };
63E5B13514EDAF2E007E9BAF /* location.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = location.png; sourceTree = "<group>"; };
+ 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iphone_delete_button.png; sourceTree = "<group>"; };
63FFDC6414E480DF00701DEC /* OPETagInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OPETagInterpreter.h; path = ../OPETagInterpreter.h; sourceTree = "<group>"; };
63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OPETagInterpreter.m; path = ../OPETagInterpreter.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -619,6 +621,7 @@
637A89FB14E1B426003F656F /* Resources */ = {
isa = PBXGroup;
children = (
+ 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */,
63E5B13514EDAF2E007E9BAF /* location.png */,
6345E57B14E2FD1200F55486 /* Blue_Dot.png */,
63E279EF14E2073C009D02BD /* Blue_Marker.png */,
@@ -845,6 +848,7 @@
6383948214EC4DDD00C74A57 /* OPEInfoViewController.xib in Resources */,
6383949814EC7DAC00C74A57 /* GTMOAuthViewTouch.xib in Resources */,
63E5B13614EDAF2E007E9BAF /* location.png in Resources */,
+ 63F9CCA514F32B2E00308DE1 /* iphone_delete_button.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN  ...xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
28 OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -37,11 +37,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "351478612.023022"
+ timestampString = "351483956.720965"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "213"
- endingLineNumber = "213"
+ startingLineNumber = "247"
+ endingLineNumber = "247"
landmarkName = "-viewDidAppear:"
landmarkType = "5">
</FileBreakpoint>
@@ -51,25 +51,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "OSM POI Editor/OPEOSMData.m"
- timestampString = "351212657.816714"
+ timestampString = "351492079.359031"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "187"
- endingLineNumber = "187"
- landmarkName = "-openChangesetWithMessage:"
- landmarkType = "5">
- </FileBreakpoint>
- <FileBreakpoint
- shouldBeEnabled = "No"
- ignoreCount = "0"
- continueAfterRunningActions = "No"
- isPathRelative = "1"
- filePath = "OSM POI Editor/OPEOSMData.m"
- timestampString = "351212657.816714"
- startingColumnNumber = "9223372036854775807"
- endingColumnNumber = "9223372036854775807"
- startingLineNumber = "161"
- endingLineNumber = "161"
+ startingLineNumber = "184"
+ endingLineNumber = "184"
landmarkName = "-openChangesetWithMessage:"
landmarkType = "5">
</FileBreakpoint>
@@ -98,7 +84,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "19"
endingLineNumber = "19"
- landmarkName = "node,theNewNode"
+ landmarkName = "node,theNewNode,type"
landmarkType = "19">
</FileBreakpoint>
</FileBreakpoints>
View
3  OSM POI Editor/OPENodeViewController.h
@@ -23,8 +23,11 @@
@property (nonatomic, strong) OPENode * theNewNode;
@property (nonatomic, strong) IBOutlet UITableView* tableView;
@property (nonatomic, strong) NSArray * catAndType;
+@property (nonatomic, strong) NSString * type;
+@property (nonatomic, strong) IBOutlet UIButton * deleteButton;
- (void) saveButtonPressed;
+- (void) deleteButtonPressed;
View
44 OSM POI Editor/OPENodeViewController.m
@@ -16,15 +16,16 @@
@implementation OPENodeViewController
-@synthesize node, theNewNode;
+@synthesize node, theNewNode, type;
@synthesize tableView;
@synthesize catAndType;
+@synthesize deleteButton;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
- // Custom initialization
+
}
return self;
}
@@ -49,6 +50,21 @@ - (void)viewDidLoad
[[self navigationItem] setRightBarButtonItem:saveButton];
+
+ deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+ [deleteButton setTitle:@"Delete" forState:UIControlStateNormal];
+ [self.deleteButton setBackgroundImage:[[UIImage imageNamed:@"iphone_delete_button.png"]
+ stretchableImageWithLeftCapWidth:8.0f
+ topCapHeight:0.0f]
+ forState:UIControlStateNormal];
+
+ [self.deleteButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+ self.deleteButton.titleLabel.font = [UIFont boldSystemFontOfSize:20];
+ self.deleteButton.titleLabel.shadowColor = [UIColor lightGrayColor];
+ self.deleteButton.titleLabel.shadowOffset = CGSizeMake(0, -1);
+ [self.deleteButton addTarget:self action:@selector(deleteButtonPressed) forControlEvents:UIControlEventTouchUpInside];
+
+
theNewNode = [[OPENode alloc] initWithNode:node];
tagInterpreter = [OPETagInterpreter sharedInstance];
@@ -61,7 +77,7 @@ - (void)viewDidLoad
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
- return 2;
+ return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -79,7 +95,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInte
return @"Category";
}
else if (section == 2) {
- return @"Value2 Style";
+ return @""; //Delete Button Header
}
else {
return @"Subtitle Style";
@@ -91,6 +107,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
NSString *CellIdentifier1 = @"Cell_Section_1";
NSString *CellIdentifier2 = @"Cell_Section_2";
+ NSString *CellIdentifier3 = @"Cell_Section_3";
NSArray * catAndTypeName = [[NSArray alloc] initWithObjects:@"Category",@"Type", nil];
@@ -103,6 +120,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1];
}
cell.textLabel.text = [theNewNode.tags objectForKey:@"name"];
+ cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;
}
else if (indexPath.section == 1) {
@@ -112,9 +130,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
cell.textLabel.text = [catAndTypeName objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [catAndType objectAtIndex:indexPath.row];
+ cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;
//cell.detailTextLabel.text = [NSString stringWithFormat:@"%d",indexPath.row];
}
- cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;
+ else if (indexPath.section == 2) {
+ cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier3];
+ if(cell == nil) {
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier3];
+ }
+
+ deleteButton.frame = cell.contentView.bounds;
+
+ [cell.contentView addSubview:deleteButton];
+ }
+
// Configure the cell...
//cell.textLabel.text = @"Text Label";
@@ -167,6 +196,11 @@ - (void) saveButtonPressed
[data deleteXmlNode:node withChangeset:change];
}
+- (void) deleteButtonPressed
+{
+ NSLog(@"Delete Button Pressed");
+}
+
- (void) setText:(NSString *)text
{
[theNewNode.tags setObject:text forKey:@"name"];
View
21 OSM POI Editor/OPENodeViewController.xib
@@ -210,24 +210,27 @@ AAgACAAIAAEAAQABAAE</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">37</int>
+ <int key="maxID">39</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">OPENodeViewController</string>
<string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">tableView</string>
- <string key="NS.object.0">UITableView</string>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">tableView</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="deleteButton">UIButton</string>
+ <string key="tableView">UITableView</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="deleteButton">
+ <string key="name">deleteButton</string>
+ <string key="candidateClassName">UIButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="tableView">
<string key="name">tableView</string>
<string key="candidateClassName">UITableView</string>
</object>
- </object>
+ </dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/OPENodeViewController.h</string>
View
5 OSM POI Editor/OPEOSMData.m
@@ -157,10 +157,7 @@ - (void) deleteNode: (OPENode *) node
}
- (NSInteger) openChangesetWithMessage: (NSString *) message
-{
-
-
-
+{
BOOL didAuth = NO;
BOOL canAuth = NO;
if (auth) {
View
2  OSM POI Editor/OPETextEdit.m
@@ -75,8 +75,8 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
- (void) saveButtonPressed
{
- [self.navigationController popViewControllerAnimated:YES];
[[self delegate] setText:textView.text];
+ [self.navigationController popViewControllerAnimated:YES];
}
@end
View
2  OSM POI Editor/OPEViewController.m
@@ -220,7 +220,9 @@ - (IBAction)addPointButtonPressed:(id)sender
-(IBAction)locationButtonPressed:(id)sender
{
+ CLLocationCoordinate2D currentLocation = [[locationManager location] coordinate];
+ [mapView moveToLatLong: currentLocation];
}
- (IBAction)infoButtonPressed:(id)sender
View
BIN  iphone_delete_button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.