2024-02-19 CLLocationCoordinate2

2024-02-18  本文已影响0人  zxh123456
CLLocationCoordinate2D *coors =  (CLLocationCoordinate2D *)malloc(gpsDictLists.count * sizeof(CLLocationCoordinate2D));
            for (int i = 0; i < gpsDictLists.count; i++) {
                NSDictionary *gps = gpsDictLists[i];
                float lat = [gps[@"lat"] floatValue];
                float lng = [gps[@"lng"] floatValue];
                coors[i] = CLLocationCoordinate2DMake(lat,lng);
            }
            MAPolyline *polyLine = [MAPolyline polylineWithCoordinates:coors count:gpsDictLists.count];
            [self.mapView addOverlay:polyLine];
上一篇 下一篇

猜你喜欢

热点阅读