Questions tagged [mkplacemark]

MKPlacemark is a class that stores address information about a specific coordinate.

MKPlacemark is a Map Kit class that stores address, locale, and points of interest information about a specific coordinate. It inherits the bulk of its properties from CLPlacemark, part of the Core Location framework.

For more information, please refer to the Apple Documentation for MKPlacemark.

37 questions
12
votes
3 answers

MKPlacemark pin title

I have my mapview working fine, but the pin that is placed on the map has the title United States. How can I change this title? MKCoordinateRegion thisRegion = {{0.0,0.0}, {0.0,0.0}}; thisRegion.center.latitude = 22.569722; …
Jesse
  • 891
  • 1
  • 13
  • 22
4
votes
1 answer

Auto scroll mkmapview when dragging pin

Is there any good code which implements auto scrolling of MKMapView when dragging pin? The effect I'm trying to achieve is a map scrolling when I drag the pin and reach edges of the map. When I move pin out of the edges I expect scrolling to stop…
Misha
  • 5,260
  • 6
  • 35
  • 63
3
votes
2 answers

Argument type error on MKPlacemark

I'm trying to write in swift a function that create a MKMapItem but I get a String error. Here is the code: func mapItem() -> MKMapItem { let addressDictionary = [String(kABPersonAddressStreetKey): subtitle] let placemark =…
Kishlin
  • 373
  • 2
  • 15
3
votes
2 answers

MKMapitem's Placemark.name is nil when creating MKMapItem from MKPlacemark

MKPlacemark *placemark1 = [[MKPlacemark alloc] initWithPlacemark:mapItem1.placemark]; MKMapItem *item = [[MKMapItem alloc] initWithPlacemark:placemark1]; NSLog(@"placemark1.name is - %@", placemark1.name) placemark1.name is -…
mkjwa
  • 141
  • 2
  • 11
3
votes
1 answer

iOS: How do I get zip code from a placemark

I am wondering how I might be able to get the placemark's zip code in iOS. Any tips or suggestions will be deeply appreciated. Here is the code I have so far, I am able to get the city. - (void)recenterMapToPlacemark:(CLPlacemark *)placemark…
2
votes
2 answers

addressDictionary is deprecated first deprecated in iOS 11.0

Just started working on IOS11, moving my code from IOS10.3 into IOS11 has resulted in the following challenge, whereas the following code used to work prior to IOS11: CLGeocoder *GeoCoder = [[CLGeocoder alloc] init]; [GeoCoder…
Heider Sati
  • 2,476
  • 26
  • 28
2
votes
1 answer

Swift MKMapItems distance from Users Location

Can someone please help me understand what I need to add to get the distance between the users location and the placemarks? I am just unsure what to change in the distanceLabel.text to make the number change to each Placemark. Thank You! import…
LBIMBA
  • 43
  • 8
2
votes
1 answer

MKPlacemark: return US state abbreviation in AdministrativeArea

I'm using the MKPlacemark class to populate a label with location specifics. When calling the AdministrativeArea property, the entire name of the US state is returned (e.g. West Virginia). Is there a way to return ONLY the initials (e.g. WV)?
dbarrett
  • 219
  • 2
  • 14
2
votes
1 answer

Reformat the string result from placemark

When i search a location sometimes i get this string from placemark.subThoroughfare how can i reformat that sign to a normal "-"? Best thanks for the answers
user656219
1
vote
0 answers

How do I fill a tableview with placemarks?

I want the user to select a specific sub-Administrative area. To do so, my plan is to show a table view with all Administrative areas (as sections) and sub-Administrative areas (as rows). Any Idea on how I can do this?
Chris Comas
  • 216
  • 4
  • 10
1
vote
0 answers

Apple Maps on iOS 13 says 'Directions Not Available' for openInMapsWithLaunchOptions

I am using Apple maps to show direction to a location from the users current location. The address details are updated in the addressDictionary as lat long are not present. MKPlacemark *destination = [[MKPlacemark alloc]…
Zaraki
  • 3,720
  • 33
  • 39
1
vote
0 answers

Map Directions From Pins

Im creating a tagging app where users can tag Street Art to a map. I want users to be able to click on the pins (i) callout button and be taken to Apple Maps. This function should allow that to happen however I get an error "instance member…
1
vote
1 answer

Crash on iOS 9 only: [MKPlacemark initWithCoordinate:]: unrecognized selector

Code: -(void)getRouteDirections{ MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init]; [request setSource:[MKMapItem mapItemForCurrentLocation]]; // It crashes on this line: MKPlacemark * placemark = [[MKPlacemark…
Ofir Malachi
  • 1,145
  • 14
  • 20
1
vote
0 answers

calculateDirectionsWithCompletionHandler not responding

I am not totally sure, but it looks like code below is not working anymore since the last ios update. the calculateDirectionsWithCompletionHandler is never answering: hours later it still hasnt responded. CLLocationCoordinate2D…
michaelsmith
  • 1,011
  • 1
  • 16
  • 35
1
vote
1 answer

Cannot invoke initializer for type 'MKPlacemark' with an argument list of type

I used LocationManager which you can find on this gitHub https://github.com/varshylmobile/LocationManager/blob/master/LocationManager.swift 2 months ago with Swift 1.2 and it was working perfectly. I just converted my app in Swift 2.0, I solved all…
Oscar Falmer
  • 1,771
  • 1
  • 24
  • 38
1
2 3