I'm trying to do the union between two MKCoordinateRegion. Does anybody have an idea on how to do this?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- iOS (objective-c) compression_decode_buffer() retu
- how to find the index position of the ARRAY Where
相关文章
- 现在使用swift开发ios应用好还是swift?
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- didBeginContact:(SKPhysicsContact *)contact not in
- Custom Marker performance iOS, crash with result “
i did a little test on both 4.3 and 5.0 and it seems that the conversion is not correct
14.718256, -40.078125, 63.837150, 70.312500
78118912.000000, 94811514.406252, 52428800.000000, 52428799.999997
17.416993, -40.078125, 63.837150, 70.312500
78118912.000000, 91803983.982924, 52428800.000000, 53344239.567355
20.649080, -40.078125, 63.837150, 70.312500
78118912.000000, 87976363.978412, 52428800.000000, 54699220.734715
24.548345, -40.078125, 63.837150, 70.312500
78118912.000000, 82962597.189840, 52428800.000000, 56765991.576236
29.305644, -40.078125, 63.837150, 70.312500
78118912.000000, 76093086.024249, 52428800.000000, 60073659.997575
There is a
MKMapRectUnion
function which accepts twoMKMapRects
so you could first convert eachMKCoordinateRegion
to anMKMapRect
and then call that function (and convert the result back to anMKCoordinateRegion
using theMKCoordinateRegionForMapRect
function).The conversion method might look like this:
Then, to actually do the union:
If anyone is looking for a swift equivalent using extensions,
And can be used like