2013-03-05 29 views
1

我使用pin point和lines在ios地圖上定位位置。 現在如何在該定位位置創建視圖。enter image description hereios map-使用緯度和經度點在ios地圖上創建視圖

In this above picture is i located the places using pin and lines. now i want to create a view inside the locating places.我該怎麼做。請一些身體幫助我解決這個問題。

回答

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

相關問題