开发者

to change the latitude and longitude dynamically of location in map iphone

how can i dynamically get the latitude and longitude so that when the user keeps on walking from his current position his direction on the map开发者_StackOverflow中文版 should also keep on changing.How is this possible


I think you could make use of MKMapview's property showsUserLocation

Taken from MKMapView Reference

showsUserLocation

A Boolean value indicating whether the map may display the user location. @property(nonatomic) BOOL showsUserLocation Discussion

This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is NO.

Setting this property to YES causes the map view to use the Core Location framework to find the current location. As long as this property is YES, the map view continues to track the user’s location and update it periodically.


As an addition to 7KV7's answer (i can't respond to answers directly yet), if you need to know when it has updated, add the mapView:didUpdateUserLocation: method to your delegate: method's documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜