问题
Im using twitter stream api for my ios project. Stream API has a location parameter. How can i get bounding box coordinates from user location(lat/long) and 1km distance ? Is there any API or tool in MapKit or mathematical functions ?
Input
(latitude = 37.785834, longitude = -122.406417)
Distance = 1000 meter
Output
latMin: 37.789934 longMin : -122.416417
latMax: 37.787834 longMax : -122.396417
回答1:
Yep, check out the functions in <MapKit/MKGeometry.h>
like MKMetersPerMapPointAtLatitude()
, which will allow you to convert distance to map points, then map points to screen points.
来源:https://stackoverflow.com/questions/24632675/get-bounding-box-from-lat-long-and-distance