有没有人有想法存储在kml文件中叠加在mapview上的圆坐标
任何帮助都会很明显
答案 0 :(得分:1)
1.使用此iOS框架解析/生成KML文件:Simple-KML
2.Calculate circle coordinates
NSMutableArray * circleCoordinates = [NSMutableArray array];
CGPoint centerCoordinate = CGPointMake(37.422f, -122.082f);
int steps = 1000; // bigger steps, smoother circle you get
float radius = 10.0;
for (int i = 0; i < steps; i++) {
KMLCoordinate *coordinate = [KMLCoordinate new];
coordinate.latitude = centerCoordinate.x + radius * cos(2 * M_PI * i / steps);
coordinate.longitude = centerCoordinate.y + radius * sin(2 * M_PI * i / steps);
[circleCoordinates addObject:coordinate];
}
3.由你得到的circleCoordinates生成框架的KML文件。
顺便说一句:你可以使用这个web KML Circle Generator来了解圆形KML文件的样子