// ? ? ? ?/**
設(shè)置地圖使其可以顯示數(shù)組中所有的overlay, 如果數(shù)組中只有一個則直接設(shè)置地圖中心為overlay的位置。
* @param overlays? ? 需要顯示的overlays
* @param animated? ? 是否執(zhí)行動畫
*/
- (void)showOverlays:(NSArray *)overlays animated:(BOOL)animated;
overlays 是覆蓋物類型數(shù)組
MAOverlay類型為:

animated是否在開始以動畫形式縮放
在地圖覆蓋物方法的劃線方法下加一個方法即可,
commonPlolyline = [MAPolyline polylineWithCoordinates:commonPolyLineCords count:[locationArray count] dra];
commonPlolyline = [MAMultiPolyline polylineWithCoordinates:commonPolyLineCords count:[self.gpsArr count] drawStyleIndexes:index];
//? ? ? ? _polyline= [MAPolyline polylineWithCoordinates:commonPolyLineCords count:[locationArray count]];
[self.mapView addOverlay:commonPlolyline];
在尾部加一句:
[self.mapView showOverlays:@[commonPlolyline] animated:YES];
即可。及數(shù)組里只有這條線一個覆蓋物。