Just another WordPress weblog
Written on June 27, 2010 at 4:11 pm, by admin
Recently, i’ve been getting to grips with some of the new APIs in iOS 4. One of the more interesting additions is the ability to add overlays using mapkit.
Without further ado, here is some sample code.
First, create a new project, and make sure to link the MapKit and CoreLocation frameworks. Add a Xib to the project, and create the accompanying view controller .h & .m files.
Open the header file and create an IBOutlet for the map view, remembering to include the MapKit header file, and make sure it knows about the MKMapViewDelegate protocol.
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface MH_mapOverlaySampleViewController : UIViewController<MKMapViewDelegate> {
MKMapView *mapView;
}
@property(nonatomic,retain)IBOutlet MKMapView *mapView;
@end
Open the xib file and add a map view, link this to the mapView outlet, and then set the mapView’s delegate to the view controller we created earlier.
Save and close the xib file, then open the view controller.m file.
First, we synthesize the map view outlet, then in the viewDidLoad method, we create a coordinate array, containing the coordinates for the overlay.
Next, create an MKPolyLine object, and pass it the coords array, and the number of items it contains.
Add the polyline object to the mapview object.
We need to implement one final method before anything will display, which is for the mapView:viewForOverlay: callback.
#import “MH_mapOverlaySampleViewController.h”
@implementation MH_mapOverlaySampleViewController
@synthesize mapView;
- (void)viewDidLoad {
[super viewDidLoad];
[[self mapView] setDelegate:self];
CLLocationCoordinate2D coords[5]={
CLLocationCoordinate2DMake(37.33444, -122.036777),
CLLocationCoordinate2DMake(37.337511, -122.036777),
CLLocationCoordinate2DMake(37.337511, -122.032228),
CLLocationCoordinate2DMake(37.33444, -122.032228),
CLLocationCoordinate2DMake(37.33444, -122.036777)
};
MKPolyline *polyLine=[MKPolyline polylineWithCoordinates:coords count:5];
[[self mapView] setCenterCoordinate:CLLocationCoordinate2DMake(37.336086,-122.03454)];
[[self mapView] addOverlay:polyLine];
MKCoordinateSpan span = MKCoordinateSpanMake(0.005, 0.005);
[[self mapView]setRegion:MKCoordinateRegionMake(CLLocationCoordinate2DMake(37.336086,-122.03454), span) animated:YES];
}
-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id)overlay{
MKPolylineView *polyLineView = [[[MKPolylineView alloc] initWithOverlay: overlay] autorelease];
polyLineView.strokeColor = [UIColor redColor];
polyLineView.lineWidth = 5.0;
return polyLineView;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)dealloc {
[super dealloc];
}
@end
Category iPhone | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on April 3, 2010 at 1:43 am, by admin
The title says it all really.
So whats it for?
VATMobile is for easy VAT/TVA calculation on your iPhone OS device.
you can:
How About A Picture…

Category VATMobile, iPhone | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on February 19, 2010 at 8:16 pm, by matt
Here it is. not a massive change, but should load a bit quicker.
Category website | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on February 16, 2010 at 2:52 am, by admin
Shift Log 2.7 has been approved by apple, and is now on sale at http://www.itunes.com/apps/shiftlog
one of our most popular features has been showing the shift duration, and in the latest version of shift log, we will now total the weeks shifts and display it inline with the section headers!

We have also given you the option of using a 12 hour, or 24 hour clock, we have split the duration out in the CSV export, so that you can now sort by shift durations, and use formulae on them, and we have added a running counter of the current shift duration to the front page!
Category Shift Log, iPhone | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on July 2, 2009 at 11:42 pm, by admin
Shift log is on Sale until the end of July!
prices vary depending on your iTunes store:
*The U.S. price applies to all countries where applications are sold in U.S. dollars. The European Union price applies to all countries where applications are sold in Euros.
Category Shift Log | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on June 28, 2009 at 12:06 am, by admin
So apple have cleared Shift Log v2.5 for the App Store!
This release adds some polish to the previous release. Shift Log will also now enable you to record additional information about each shift, including:
Shift Log will now display a badge telling you if you have an unfinished shift running,
And last but not least, Shift Log will now display the duration of each shift,in hours and minutes, and also in decimal hours. This option can be changed in the settings application.
Category Shift Log, iPhone | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Written on June 18, 2009 at 10:24 am, by admin
Apple have finally released the 3.0 update, it’s mostly more of the same.
Apple have taken an already good system and added polish.
Some of the new features you will come across:
whilst these new features are great, there are other features that will create a much better experience as time goes on;
New developer APIs:
Category iPhone | Tags:
Social Networks : Technorati, Stumble it!, Digg, de.licio.us, Google, Twitter, Yahoo, reddit, Blogmarks, Ma.gnolia.
Entries (RSS) and Comments (RSS)
Mostly Harmless blog is proudly powered by WordPress.org
Theme derived from brianpurkiss' whiteboard