I have a view with 3 buttons (Europe, Asia, America) and a MKMapView.
If one of these buttons was clicked, i need to show the specific continent.
In
MKGeometry.h (Mapkit Framework)
there is a constant
MKMapRectWorld
which i can use to show the whole world.
Is there something similar for continents?
If not, what is the best way to determine all informations i need for creating a MKCoordinateRegion?
Use Google Earth or Goole Maps to work out the lat/long boundaries and then call setRegion on your map view.
Related
I want to make my app open another View Controller on the tap of an already present place on the map. When you open a map there are many places shown on map with their names i think they are called land marks. I want to make it so when a user selects such landmark i show information to him about it. The problem is I want that user directly clicks on such place and don't want to make annotations on map Is this possible?
I'm trying to display a text at a certain location on a mapView.
I can display annotations, overlays like polylines, etc.
But how can I do to display a simple text directly on a map ?
I can't find any documentation on that anywhere (for the moment ;)
Thanks for your help !
I'm looking for a way to display the transit/subway lines in a MapKit view. I'd basically like the same view as the "Transit" view in the Maps application. I can't find the right overlay or map type. Thanks!
Transit map type is not available yet. You might have to customize your own mapView.
Is there a way how can I change callout view when there are multiple annotations at same position? If there is one then just show normal callout and if there is more then I would like to show callout with text like: "3 items at this place" and then I would go to table view and then to detail (with one item at place just go to detail place). Is it possible? What's best way to do this? Thanks
This technique is called clustering. Check out cocoacontrols.com for some approaches for doing this with MapKit.
About 18 minutes into the WWDC 2011 #111 - Visualizing Information Geographically with MapKit video, Apple illustrates an example of how you can prevent overlapping annotations (including some nice animation revealing and hiding more detailed annotations as you zoom in and out). It could easily be adapted to handle the different callouts that you describe, too.
I have two annotations with the same coordinates. And I have to display them on the map. When I add these annotations on the map I see just one pin. How can I display two annotations instead of one? Or how can I display a annotations list by clicking on the pin? Can anybody help me?
Thanks in advance.
Igor
When you try to display multiple annotations at the same coordinate on a map using MapKit, generally it will actually place two different pins, but they will be in the exact same location. You can compare the difference in the shadow strength to see the difference, however; look at a single pin's shadow, then look at your double-pin shadow, and you should see the latter appear darker.
In terms of indicating to your user that there are multiple pins, there are several ways you could do that. You might consider implementing the title or subtitle properties on your annotations to display the number of annotations at the same coordinates (e.g. set subtitle to the string #"(and two more)" or similar). Then, when the callout accessory view is tapped, push (onto a navigation controller stack) a table view of annotations at that location.