Hi
Can i use MapKit framework for the applications based on 2.2.1 sdk, will it be acceptable or not by the apple, I am struggling for a lot of days . I am supposed to use same functionalities supported by 3.0 sdk mapkit framework , in 2.2.1 sdk. I have no idea how to show map like that and pop up for anotation. and screen redirection when click on that pop up. if i use this framework in my project will it be acceptable ????
Hi
Can i use MapKit framework for the applications based on 2.2.1 sdk, will it be acceptable or not by the apple, I am struggling for a lot of days . I am supposed to use same functionalities supported by 3.0 sdk mapkit framework , in 2.2.1 sdk. I have no idea how to show map like that and pop up for anotation. and screen redirection when click on that pop up. if i use this framework in my project will it be acceptable ????
I do not believe it will be accepted by Apple, since the MapKit is for OS 3.0. I am trying to figure out on my own when we can submit the apps based on 3.0 SDK. I would imagine it should be on the release of the OS, but would make sense that apple will allow it now...
Yet in my experiences, I see that Apple is already asking questions if the app has been testing on 3.0....
Hi varchar
Thank you very much for atleast replying,
I have seen some applications which are using same things in 2.0,
but how i dont understand. you can check myhomes application
my requirement is when i click on the marker it should show some image type of pop up with details. I am getting it but through javascripting . now i need when i click on that pop up my screen should be redirected to other screen by navigationController.pushviewcontroller , and i hope if i write this code in javascript it wont run and map will come blank. do you have any idea how to show objective c components when i click on marker in webview.
help will be highly appreciated. I am stucked here on this point. I have my deadline for day after tommorow
Hi varchar
Thank you very much for atleast replying,
I have seen some applications which are using same things in 2.0,
but how i dont understand. you can check homes application(link is homes.com)
my requirement is when i click on the marker it should show some image type of pop up with details. I am getting it but through javascripting . now i need when i click on that pop up my screen should be redirected to other screen by navigationController.pushviewcontroller , and i hope if i write this code in javascript it wont run and map will come blank. do you have any idea how to show objective c components when i click on marker in webview.
help will be highly appreciated. I am stucked here on this point. I have my deadline for day after tommorow
Hi varchar
Thank you very much for atleast replying,
I have seen some applications which are using same things in 2.0,
but how i dont understand. you can check homes application(link is homes.com)
my requirement is when i click on the marker it should show some image type of pop up with details. I am getting it but through javascripting . now i need when i click on that pop up my screen should be redirected to other screen by navigationController.pushviewcontroller , and i hope if i write this code in javascript it wont run and map will come blank. do you have any idea how to show objective c components when i click on marker in webview.
help will be highly appreciated. I am stucked here on this point. I have my deadline for day after tommorow
Narender,
Interesting what you are trying to do, I literally wrote the code earlier today... I am at a client site now, but will return to my code base in a few hrs, then I will post the code for you which hopefully will help you....
In the meantime, some pointers:
First, I assume you are using the MKMapView class.
Interesting what you are trying to do, I literally wrote the code earlier today... I am at a client site now, but will return to my code base in a few hrs, then I will post the code for you which hopefully will help you....
In the meantime, some pointers:
First, I assume you are using the MKMapView class.
Make sure you build the MKAnnotationView which has the button in the leftaccessoryview.
Above maybe not make sense... I will just post code which will help.. give me a few hrs to get back.
@Varchar
Thanks a lot man
i will be waiting for the post. i hope you are talking about the google code's mapview class. if it is like that i downloaded the code and try to understand how to implement it. but there is no documentation for that. well will continue after your post.
thanks dear.
@Varchar
Thanks a lot man
i will be waiting for the post. i hope you are talking about the google code's mapview class. if it is like that i downloaded the code and try to understand how to implement it. but there is no documentation for that. well will continue after your post.
thanks dear.
Narender,
I am not sure which code library you are referring to, but based on what I see you are trying to do, I suggest going with the iPhone SDK 3.0 MapView since it is quite easy to work with and very flexible.
Here is the code base and explanation on how to add button to callout.
Below is the method which handles drawing the view for the annotation depending on the type of annotation.
Code:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
//NSLog(@"Annotation called: %@",[annotation title]);
MKPinAnnotationView *currentLocationAnnotationPinView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"thisAnnotation"];
MKAnnotationView *currentLocationAnnotationImageView=[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"thisAnnotation"];
MKAnnotationView *currentMarkerAnnotationView=[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"thisAnnotation"];
if([[annotation title] isEqualToString:@"Current Location"])
{
// Use a pin for current location - below is commented out since we do not want to use the pin, but our own custom image
/* [currentLocationAnnotationPinView setPinColor:MKPinAnnotationColorPurple];
currentLocationAnnotationPinView.animatesDrop = YES;
return currentLocationAnnotationPinView;
*/
currentLocationAnnotationImageView.image = [UIImage imageNamed:@"Car.png"];
currentLocationAnnotationImageView.canShowCallout = YES;
return currentLocationAnnotationImageView;
}
else // Use a view for marker
{
// Set up the Left callout
UIButton *myDetailButton = [UIButton buttonWithType:UIButtonTypeCustom];
myDetailButton.frame = CGRectMake(0, 0, 23, 23);
myDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
myDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
// Set the image for the button
[myDetailButton setImage:[UIImage imageNamed:@"favorites.png"] forState:UIControlStateNormal];
// Set the button as the callout view
currentMarkerAnnotationView.leftCalloutAccessoryView = myDetailButton;
// Set the annotionview to an image
currentMarkerAnnotationView.image = [UIImage imageNamed:@"favorites.png"];
currentMarkerAnnotationView.canShowCallout = YES;
return currentMarkerAnnotationView;
}
Below is the code which handles the tap on the button in the accessory annotation.
You see how easy the implementation is using the MKMapView classes using iPhone 3.0... its pretty cool.
Now, if you are unable to wait for the release (which is less then 2 weeks away), then you may want to use the RouteMe code library which is very handy and many of my apps use it...
Here is some code which handles taps and taps on labels...
Code:
- (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map {
NSLog(@"taponmarker");
// Hide any markers which have been tapped before...
for(RMMarker *marker in [map.markerManager getMarkers]) {
[marker hideLabel];
}
// Show this current marker label
[marker showLabel];
}
- (void) tapOnLabelForMarker: (RMMarker*) marker onMap: (RMMapView*) map {
NSLog(@"taponlabelformarker clicked");
}
I hope the above will help you.... for the MKMapView code above you can literally do a copy and paste into your code and it should work.... Just wrote this code this morning...
@varchar
Thank you very very much.
Its being a helping hand of you.
I am very thankful to you for sharing your code with me.
I will try it out and will be back to you once my code will work
or i have some problem
again thanks a ton to you.
@varchar
Thank you very very much.
Its being a helping hand of you.
I am very thankful to you for sharing your code with me.
I will try it out and will be back to you once my code will work
or i have some problem
again thanks a ton to you.
It's my pleasure.... That is one of the main purposes of this great forum we have here to help one another
Good luck and ping me if I can help in any other way....
Hi Varchar,
I am using route-me and able to show markers with pop up textlabel on it. but i wanted it to be some button or something not a simple label. i tried to put one btn inside one view and replace [marker setLabel:bView] and it is displaying it, but the problem is that is not excepting any touch event/click event. here is my code.
I implemented map view from mapkit(3.0) in my application it's working fine. But when ever i tap on pin my delegate method below i mentioned not at all calling. my map view class derived from UIView class, is this problem?.if any one reply as soon as possible.
Hi all,
I know here is a discussion of simple map in 3.0 and sorry to change the topic but my expectation is any one of you might be aware of it. I saw one application earthscape there they are using something like google earth. I would like to do something like that to move earth on my iphone screen. I dont have any idea how did they acheive that. Please direct me to the solution.
How to make google earth kind of application as native iphone application.
It will work in English preferenceds. In the other languages this title is other (for example, "Bieżące położenie" in Polish). Better to use code like this:
Code:
if ([annotation isMemberOfClass:[MyAnnotation class]] == NO)