这是我如何绘制它的代码
int pointCount = [routeLatitudes count] / 2; //routeLatitudes is the array that contains the coordinates latitude followed by longitude.
MKMapPoint* pointArr = malloc(sizeof(MKMapPoint) * pointCount); int pointArrIndex = 0; for (int IDx = 0; IDx < [routeLatitudes count]; IDx=IDx+2) { CLLocationCoordinate2D workingCoordinate; workingCoordinate.latitude=[[routeLatitudes objectAtIndex:IDx] doubleValue]; workingCoordinate.longitude=[[routeLatitudes objectAtIndex:IDx+1] doubleValue]; MKMapPoint point = MKMapPointForCoordinate(workingCoordinate); pointArr[pointArrIndex] = point; pointArrIndex++; } // create the polyline based on the array of points. routeline = [MKpolyline polylineWithPoints:pointArr count:pointCount]; [mapVIEw addOverlay:routeline]; free(pointArr);
并显示/隐藏折线我创建了一个参考MKOverlayVIEw * overlayVIEw = nil;
overlayVIEw.hIDden=false/true;
现在我需要知道如何删除/删除绘制的折线.
预先感谢.
解决方法 试试这个[mapVIEw removeOverlays:mapVIEw.overlays];总结
以上是内存溢出为你收集整理的iphone – 从地图Xcode上删除折线全部内容,希望文章能够帮你解决iphone – 从地图Xcode上删除折线所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)