I am working on an iPhone app in which I am implementing a map view. When the map loads, a purple pin is displayed at the current location. My problem is that I want to show the current location on a new view when the user touches this purple pin.
Any idea?
Please help.
Thanks,
Aaryan
When a user taps an annotation pin, callout annotation and accessory views can be displayed. The callout accessory views can be controls (buttons) with associated actions.
If callout views will not meet your needs, you could instead put invisible buttons with your own actions over the pins on the map view.
In either case, you can display views, navigate, etc in the method(s) called by the button actions.
Related
I have my screen split; 50% for the map and 50% for a list of elements. As the list of elements is scroll, the annotation will pop around the map based off whichever element is in the top of the list. This part is working fine.
However, when the user taps on the map, I don't want the annotation to disappear. I really want the user's tap to interactive with the MapView instead of the AnnotationView.
Is this possible? If so, can someone point me in the right direction? Thanks.
You have a couple of options:
You can intercept the built-in tap gesture recognizer or add a custom tap gesture recognizer. When the user taps the map, check if an annotation is selected. If one is selected, call mapView:selectAnnotation: to keep it selected.
You can call mapView:selectAnnotation: in the relevant mapView:deselectAnnotation: or mapView:deselectAnnotationView: delegate method.
Im using the Google Map's SDK and want the user to fill out some information about a marker.
So the user presses on the map to place a marker, I want a small pop up to come over the map and ask the user to input some text about the location. Should that pop up be its own view controller or should it be a UIView and subview the mapController?
I want to add custom annotationView callout which contains
1. Title
2. subtitles
3. a button
The button can display on the right (rightCalloutAccessoryView) or left leftCalloutAccessoryViewsides of the callout. I want to add the button in the middle of the callout and under title->subtitle. How can I do?
There is no API for this. You could try not using the standard callout (canShowCallout = NO), catch the taps and drags on the AnnotationView manually and show your own UI by adding custom Views based on the position of the AnnotationView. This seems very fragile, though.
I have a checkin related app. When user clicks a venue on map, callout will popup and show its name and address. At the same time, if the venue is within 1000m from current location, a check in button will be displayed.
To a venue that can checkin, all I want is,
when callout is popup, check in button shows. when callout is disappear, that button disappears too.
Now show button works well, but I don't know how to detect callout visible status. Is there any callback method that callout show/hide?
Thanks in advance!
Callout appears when annotation is selected - you can use mapView:didSelectAnnotationView: method in delegate to track that event. Callout hides when annotation is deselected - use mapView:didDeselectAnnotationView: method to track that event.
As you can see here it is about selected property of MKAnnotationView, which is saying that If the property contains YES, the annotation view is displaying a callout bubble.
You may additionally implement an observer for this property, to implement your functionality.
I want to pop up a view when user touch on the screen,it is just like a tableview cell with disclosure accessory button.It has text showing message and when the user press the accessory button,it will take some action.
I have seen a similar example in iphone cookbook, it create a UICalloutView:UIControl,
but it seems that it uses some private API.
can anyone tell me how to achieved this?
Well, it's probably private. You could printScrn the accessory and add it as a resource to your project, and use it as an image.