I'm creating an iPhone application that gets the user to drop a pin where ever they want. After they drop the pin the user then clicks on it and i want it to show the location of the pin in the call out as the subtitle.
I have the mapview set up as well as the call out working and also the user is able to drop the pin where ever they want to on the map.
I know there is a tutorial for dragging and dropping a pin and they do cover something of this sort. But i'm actually really confused and was wondering if someone could point me in the right direction.
I've a good tutorial regarding the draggable pin.
The source code is available: http://github.com/digdog/MapKitDragAndDrop
Related
Hello everyone i am stuck into one problem. I am working on Application in which Mall Map required to integrate.
I need to display Mall map like this:
I have done proper r&d but not found any solution yet.
Can it be possible if yes then how can i implement this ?
Any hint or suggestion will be appreciated.
Thanks.
You could display the map in a UIImage and place this image in a UIScrollView. After that you need to divide the image into region rectangles, each identifying one room.
When the user taps the UIScrollView you need to determine which region he tapped on.
Using your room grid you can detect which room he tapped on. Of course this is easier for not zoomed images.
In a zoomed state you need to convert the touched point to the "unzoomed touched point" and check this point for the grid.
I am using CLLocationManager to retrieve current location in my app and display using MapView, i want to slide the map so that the current location should also change to the new location where the map slides and it should annotate to the new location, how to do it? Please give your suggestions with sample code.
You probably don't mean "the current" since that means where the phone actually is, unless you want to transport the phone to another place when using this app which would be quite a feat. So, how about drawing a layer over the top of your map that keeps a pin drawn at the centre so it looks as if the pin is moving over the map, but really the map is moving under the pin.
I have a offline map tiles, i display it and also zoom in zoom out functionality in that and it's working very well, but now i want to drop multiple pins on offline map tiles and also want to get lat-long of that drop pin how it's possible ? please help me.
you will get definitely solution form this link Offline Maps iPhone
I have check and get lat and long when i click on map. so on click event u will drop a pin.
in this link u will see the answer which is given by Ruben Esposito.
MAy be it help.
I am working on the map application and as per requirement i need to show a single pin for a single region even if it has multiple user coordinates when its completely zoomed out but when its zoomed in to the map then i should display all the pins as per its coordinates.
I have given example below to explain my problem.
I have city New York on this city I have 100 pins on my mapview when I am zooming out of my map it should show me only one annotation pin on the place of 100 pins but when I am zooming in then it should show again 100 pin on map.
Does any one knows about this. I need suggestion. Please note that I am getting all the locations from web services except my current location. This should not be affecting application so that application shouldn't become slow.
Please suggest some solution.
The Apple WWDC 2011 video, "Visualizing information geographically with MapKit", https://developer.apple.com/videos/wwdc/2011/
shows how to cluster map annotations - it's exactly what you need.
Of course there is a control for that...
Take a look at OpenClusterMapView, it should be exactly what you need.
There is no API for this.
You will need to manage the pins yourself. As a user zooms in on the map, you will need to decide at what point to remove the aggregated pin and add the individual pins. Inversely, as a user zooms out you will need to remove the individual pins and replace with the aggregated pin.
Might be a good idea to use a custom pin for the aggregated pin to suggest that it represents multiple pins.
I think this link might help you know the current zoom level:
Zoom and Region
Link to a similar question:
Pin Overlap
I have been checking a couple of related posts regarding the callout behaviour. I know didAddAnnotationViews could bring annotation view along with the pin when it starts dropping. But what I actually want is show the annotation AFTER the pin is dropped onto the map, just like when you search an address in "Maps" application on iPhone, the pin drops on the map, and then the annotation pops up. Does anyone know how to do that? Do I need to do some customisation on the annotation view? Thanks.