GeoField,Lat / Long坐标

时间:2015-10-25 01:00:18

标签: ios objective-c drupal mkmapview

我使用Drupal的Geofield模块将地址转换为纬度和频率经度坐标。在我的iOS应用中,我尝试使用以下代码抓取它吐出的坐标,并在我的mapview上的位置放置注释:

   NSMutableDictionary *userData = [NSMutableDictionary new];

    NSDictionary *pins = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:userData, nil] forKeys:[NSArray arrayWithObjects:@"und", nil]];

    NSDictionary *morepins = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:pins] forKey:@"field_position"];

            NSLog(@"%@", userData);
            NSLog(@"%@", morepins);


   CLLocationCoordinate2D coord = {[[morepins objectForKey:@"lat"] doubleValue], [[morepins objectForKey:@"lon"] doubleValue]};


    mapPin *ann = [[mapPin alloc] init];
    ann.title = @"You are here";
    ann.subtitle = @"Let's go!";
    ann.coordinate = coord;
    [mapView addAnnotation:ann];

但是当我记录userData和morepins时,两者都是空的。我正在使用Drupal iOS SDK - 有谁知道我在这里做错了什么?我试图抓住拉特和利昂的领域。以下是Drupal如何显示数据:

enter image description here

0 个答案:

没有答案