How can I convert CLLocation
or CLLocationCoordinate2D
to CGPoint
.
I have seen
CGPoint point = [mapView convertCoordinate:myCoordinates toPointToView:self.view];
But I don't need to use mapView
in my case. I tried googling, but didn't come across anything helpful.
Edit: I need to convert the geographic coordinates to iPad's screen coordinate as in Convert decimal latitude/longitude coordinates to iPad screen coordinates. I am trying to draw line/path based on the converted coordinate values.
Is there a direct way to do it, or do I need to write an algorithm to do the same.
CGPoint myPoint = CGPointMake(coordinate.longitude, coordinate.latitude);
Note that the axes are swapped. But unless you give a coordinate system that you want the coordinate converted to, your question doesn't make sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With