想实现在地图上划线的功能,于是按照api手册写了以下代码:
NSLog(@"划线");
MAMapPoint *arrayPoint = malloc(sizeof(MAMapPoint) * 2);
arrayPoint[0] = MAMapPointMake(38.7f, 117.48f);
arrayPoint[1] = MAMapPointMake(50.6f, 117.48f);
MAPolyline *line = [MAPolyline polylineWithPoints:arrayPoint count:2];
[self.mapView addOverlay: line];
free(arrayPoint);
但是地图上不显示根据这两个点所化的直线。请问这是什么原因?
Should we implement overlay proxy?