[英]Get place names using CLGeocoder (not street names)
I want to develop my own maps app. 我想开发自己的地图应用。 I have been successful in getting a street address at the point of touch on my iPhone using
CLGeocoder
. 我已经成功使用
CLGeocoder
在iPhone上的触摸点获得了街道地址。 Now my question is the following: 现在我的问题是:
https://maps.google.com/?q=37.324599,-122.031844
https://maps.google.com/?q=37.324599,-122.031844
类的URL来获取有关地点的信息 CLGeocoder
will only give me its street address ie 10110 N De Anza Blvd Cupertino, CA 95014
(I get this). CLGeocoder
只给我其街道地址,即10110 N De Anza Blvd Cupertino, CA 95014
(我知道了)。 But how to get the actual name ie St Joseph of Cupertino Church and Parish
? St Joseph of Cupertino Church and Parish
? Is there any way to access those place names (Not just by CLGeoCoder
, any way is fine). 有什么方法可以访问那些地名(不仅仅是
CLGeoCoder
,任何方法都可以)。
The GeoCoding API in general is for converting between street addresses and coordinates. 通常,GeoCoding API用于在街道地址和坐标之间进行转换。 If you want place names you can probably use the Places API.
如果需要地名,则可以使用Places API。
(I know this is more of a comment than an answer, but I think I don't have enough reputation points to comment on questions yet) (我知道这更多是评论,而不是答案,但我认为我没有足够的声誉积分来评论问题)
YOu need t odo like this way after getting lat long use this code by CLLocation manager class 您需要更长的时间后,才需要像这样的odo来通过CLLocation管理器类使用此代码
{ {
CLGeocoder *reverseGeo = [[CLGeocoder alloc] init];
[reverseGeo reverseGeocodeLocation: loc completionHandler:
^(NSArray *placemarks, NSError *error) {
NSLog(@"%@",[placemarks objectAtIndex:0]);
for (CLPlacemark *placemark in placemarks) {
NSLog(@"~~~~~~~~%@",placemark.locality);
}
}];
} }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.