ios map-使用纬度和经度点在ios地图上创建视图

时间:2013-03-05 05:51:53

标签: cocoa-touch ios4 google-maps-api-3 ios6

我使用针点和线在ios地图上找到了位置。 现在如何在该定位位置创建视图。 enter image description here

In this above picture is i located the places using pin and lines. now i want to create a view inside the locating places.我该怎么办?请一些人帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

您在屏幕上有注释。注释是纬度和经度值。

    NSArray *data = [root objectForKey:@"data"];
    for (NSArray *row in data) {
    NSNumber * latitude = [[row objectAtIndex:22]objectAtIndex:1];
    NSNumber * longitude = [[row objectAtIndex:22]objectAtIndex:2];
    NSString * crimeDescription = [row objectAtIndex:18];
    NSString * address = [row objectAtIndex:14];

    CLLocationCoordinate2D coordinate;
    coordinate.latitude = latitude.doubleValue;
    coordinate.longitude = longitude.doubleValue;
    MyLocation *annotation = [[MyLocation alloc] initWithName:crimeDescription address:address coordinate:coordinate] ;
    [_mapView addAnnotation:annotation];
}

它可以帮到你 1. http://www.raywenderlich.com/21365/introduction-to-mapkit-in-ios-6-tutorial

http://spitzkoff.com/craig/?p=1082