Questions tagged [mkcoordinatespan]

MKCoordinateSpan is a struct used in Map Kit to describe the size of a given area rectangle.

MKCoordinateSpan is a struct used in Map Kit to describe the size of a given area rectangle. It is typically used to express a desired zoom level of the map or to get the size of the currently visible map region.

For more information, refer to the Apple Documentation for MKCoordinateSpan.

14 questions
29
votes
3 answers

MKCoordinateSpan in Meters?

I need to create a MKCoordinateSpan that is about 500 meters. How do I calculate the values to pass into the MKCoordinateSpan constructor? Answers in any programming (Obj-C, .Net) language are fine.
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
16
votes
3 answers

Trying to get the span size in meters for an iOS MKCoordinateSpan

When I need to make an MKCoordinateRegion, I do the following: var region = MKCoordinateRegion .FromDistance(coordinate, RegionSizeInMeters, RegionSizeInMeters); very simple - works perfectly. Now I wish to store the value of the…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
14
votes
3 answers

Get TopLeft and BottomRight from MKCoordinateRegion MKMapView

I checked the properties in documentation for MKCoordinateRegion, MKCoordinateSpan and MKMapView to see there is a way to get the TopLeft and BottomRight Lat Long from the map view and I didn't find any. I know that the span gives me the Lat long…
Dave
  • 4,038
  • 9
  • 45
  • 57
3
votes
1 answer

How to store current MKCoordinateRegion or zoom level?

I have an app which is providing a zoomable MKMapView to the user. I want to be able to store the user's preferred coordinates and zoom level for when the map view is first displayed. Currently, in viewDidLoad, I am providing a default set of…
beev
  • 1,197
  • 2
  • 16
  • 33
3
votes
1 answer

MKMapView zooms itself out

This is a small method of mine which takes the location manager's current location and focuses the map just a little bit above it to make room for some other subviews that I've added to the top of the map. If the span's lat/long deltas get too big…
eric.mitchell
  • 8,817
  • 12
  • 54
  • 92
2
votes
0 answers

MKMapView maximal value for distance?

I have a problem with MKCoordinateRegionMakeWithDistance. I try to specify the distance value via a slider in the preferences of my iPad App. When I put in more that 963 as int or float, the mapView don't apply the value and takes it's own value. Is…
2
votes
1 answer

mapkit: region that fits does not render correctly

I have a piece of code that determines both best region.span.latitudeDelta and region.span.longitudeDelta. It finds the top left and bottom right and takes the diff between lat-coordinates and long-coordinates. The problem I have is that rendering…
zevij
  • 2,416
  • 1
  • 23
  • 32
2
votes
1 answer

iPhone dev - showing two locations on the map

Now I have the coordinate of two locations, let say locationA with latitude 40 and longitude -80, locationB with latitude 30 and longitude -70, I want to create a mapView that I can see both locations with appropriate viewing distance. I got the…
Brian
  • 235
  • 3
  • 11
1
vote
1 answer

Find the mid point between two CLLocationCoordinate2D when going over 180 degrees

I have the following code to work out the MKCoordinateRegion to display the map including two defined points. The problem is it doesn't work when the longitude goes over 180 or -180 degrees. CLLocationCoordinate2D tempPoint1 =…
1
vote
2 answers

iOS MapView not updating to specified span

I have a map in my iOS application that won't set the visible region to where I'm specifying it. - (void)mapView:(MKMapView *)aMapView didUpdateUserLocation:(MKUserLocation*)aUserLocation { MKCoordinateSpan span; span.latitudeDelta =…
barndog
  • 6,975
  • 8
  • 53
  • 105
1
vote
2 answers

iOS: Objectifying MKCoordinateSpan to put in an array

Im trying to find a direct way to put MKCoordinateSpan into an array without breaking it down to lat and long and store it in an NSArray. Not sure if there is such way.
Byte
  • 2,920
  • 3
  • 33
  • 55
0
votes
2 answers

How to zoom out of an MKMapView without using didAddAnnotationViews?

I am trying to find a way to do a zoom in and out via a button. If I put code within the method didAddAnnotationViews, it will set the initial zoom perfectly. I tried to get the zoom to change with the code below, but it keeps on crashing…
logixologist
  • 3,694
  • 4
  • 28
  • 46
0
votes
1 answer

How to get current coordinate span in swiftUI?

I'm working with a map kit map and I need to get the current value of the coordinate span model. So that when you click on the map point, the map itself does not jump. import SwiftUI import MapKit struct MapScreenView: View { @StateObject…
0
votes
0 answers

Map Region is Spaned for Userlocation not for Custom Location

Well it is really a silly question & confusing. I am trying to get the map to span & focus on certain region , so I set the location as Userlocation, it is perfect. Although when I save the user location & try to upload them in viewDidLoad, it…
TALAA
  • 6,184
  • 1
  • 13
  • 21