Overlay Images and Overlay Views with MapKit Tutorial
16 posts
• Page 1 of 2 • 1, 2
Overlay Images and Overlay Views with MapKit Tutorial
This is the official thread to discuss the following blog post: Overlay Images and Overlay Views with MapKit Tutorial
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

rwenderlich - Site Admin
- Posts: 1776
- Joined: Thu Dec 23, 2010 4:14 pm
- Has thanked: 26 times
- Been thanked: 187 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
How different is the API between MapKit and Google Maps API?
-

shippo0708 - Uber Haxx0r
- Posts: 468
- Joined: Fri Apr 15, 2011 4:06 am
- Has thanked: 2 times
- Been thanked: 27 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
shippo0708 wrote:How different is the API between MapKit and Google Maps API?
As far as the iOS side goes, there really is no difference that I am aware of. They left the interfaces/APIs the same for MapKit and just changed the underlying implementations.
- cwagdev
- iOS Tutorial Team Member
- Posts: 45
- Joined: Mon May 14, 2012 8:41 pm
- Has thanked: 2 times
- Been thanked: 7 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
I'm getting an error in the initWithFilename method of PVPark.m for _overlayTopRightCoordinate stating this property is not found?
I have even copy / pasted the sample code from the tutorial and get the same error.
When I look at the auto complete of the properties I only see three in the list, _overlayBottomLeftCoordinate, _overlayBottomRightCoordinate and _overlayTopLeftCoordinate

I have even copy / pasted the sample code from the tutorial and get the same error.
When I look at the auto complete of the properties I only see three in the list, _overlayBottomLeftCoordinate, _overlayBottomRightCoordinate and _overlayTopLeftCoordinate
- elpuerco63
- Uber Haxx0r
- Posts: 226
- Joined: Tue Jun 28, 2011 10:16 am
- Has thanked: 1 time
- Been thanked: 2 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
elpuerco63 wrote:I'm getting an error in the initWithFilename method of PVPark.m for _overlayTopRightCoordinate stating this property is not found?
Check if you really have the following additional getter, but not the getter for overlayTopRightCoordinate:
- Code: Select all
- (CLLocationCoordinate2D)overlayBottomRightCoordinate
{
return CLLocationCoordinate2DMake(self.overlayBottomLeftCoordinate.latitude, self.overlayTopRightCoordinate.longitude);
}
Re: Overlay Images and Overlay Views with MapKit Tutorial
elpuerco63 wrote:I'm getting an error in the initWithFilename method of PVPark.m for _overlayTopRightCoordinate stating this property is not found?
I have even copy / pasted the sample code from the tutorial and get the same error.
When I look at the auto complete of the properties I only see three in the list, _overlayBottomLeftCoordinate, _overlayBottomRightCoordinate and _overlayTopLeftCoordinate
Verify that PVPark.h declares the property.
- Code: Select all
@property (nonatomic, readonly) CLLocationCoordinate2D overlayTopRightCoordinate;
- cwagdev
- iOS Tutorial Team Member
- Posts: 45
- Joined: Mon May 14, 2012 8:41 pm
- Has thanked: 2 times
- Been thanked: 7 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
akonakov wrote:elpuerco63 wrote:I'm getting an error in the initWithFilename method of PVPark.m for _overlayTopRightCoordinate stating this property is not found?
Check if you really have the following additional getter, but not the getter for overlayTopRightCoordinate:
- Code: Select all
- (CLLocationCoordinate2D)overlayBottomRightCoordinate
{
return CLLocationCoordinate2DMake(self.overlayBottomLeftCoordinate.latitude, self.overlayTopRightCoordinate.longitude);
}
There's actually not a defined getter for overlayTopRightCoordinate, it is a defined property and assigned. overlayBottomRightCoordinate happens to be a property that can be inferred, so that is the reason I went with having an custom getter for it.
- cwagdev
- iOS Tutorial Team Member
- Posts: 45
- Joined: Mon May 14, 2012 8:41 pm
- Has thanked: 2 times
- Been thanked: 7 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
akonakov wrote:elpuerco63 wrote:I'm getting an error in the initWithFilename method of PVPark.m for _overlayTopRightCoordinate stating this property is not found?
Check if you really have the following additional getter, but not the getter for overlayTopRightCoordinate:
- Code: Select all
- (CLLocationCoordinate2D)overlayBottomRightCoordinate
{
return CLLocationCoordinate2DMake(self.overlayBottomLeftCoordinate.latitude, self.overlayTopRightCoordinate.longitude);
}
Cha ching!
Thanks
- elpuerco63
- Uber Haxx0r
- Posts: 226
- Joined: Tue Jun 28, 2011 10:16 am
- Has thanked: 1 time
- Been thanked: 2 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
This bit of code confuses me only due to the fact that boundary is declared as CLLocationCoordinate2D and not an NSArray?
I understand the setting of memory allocation using malloc but not about why you are doing it this way?
Is there an advantage in doing it this way over using NSArray and its addObject method?
I understand the setting of memory allocation using malloc but not about why you are doing it this way?
Is there an advantage in doing it this way over using NSArray and its addObject method?
- Code: Select all
@property (nonatomic, readonly) CLLocationCoordinate2D *boundary;
_boundary = malloc(sizeof(CLLocationCoordinate2D)*_boundaryPointsCount);
for(int i = 0; i < _boundaryPointsCount; i++) {
CGPoint p = CGPointFromString(boundaryPoints[i]);
_boundary[i] = CLLocationCoordinate2DMake(p.x,p.y);
}
- elpuerco63
- Uber Haxx0r
- Posts: 226
- Joined: Tue Jun 28, 2011 10:16 am
- Has thanked: 1 time
- Been thanked: 2 times
Re: Overlay Images and Overlay Views with MapKit Tutorial
Thanks for the tutorial!
Last edited by tamarawirz on Fri Mar 08, 2013 10:37 am, edited 1 time in total.
TWE LLC
-

tamarawirz - Baby Hacker
- Posts: 6
- Joined: Sat Aug 13, 2011 7:47 pm
- Location: Texas
- Has thanked: 0 time
- Been thanked: 0 time
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 10 guests