Convert CLLocation or CLLocationCoordinate2D to CGPoint

How to convert CLLocation or CLLocationCoordinate2D to CGPoint . I have seen

 CGPoint point = [mapView convertCoordinate:myCoordinates toPointToView:self.view]; 

But I do not need to use mapView in my case. I tried searching the Internet but did not find anything useful.

Edit: I need to convert geographic coordinates to iPad screen coordinates, as in Convert decimal latitude / longitude coordinates to iPad screen coordinates . I am trying to draw a line / path based on the converted coordinate values.

Is there a direct way to do this, or do I need to write an algorithm to do the same.

+4
source share
1 answer
 CGPoint myPoint = CGPointMake(coordinate.longitude, coordinate.latitude); 

Note that the axes are swapped. But if you do not give the coordinate system in which you want to transform the coordinate, your question does not make sense.

+8
source

Source: https://habr.com/ru/post/1487457/