Incorrect position rendering of WGS84 coordinate in MKMapView: Discrepancy between Apple Maps (Hong Kong) and Amap (Mainland China)

I am encountering a coordinate rendering issue using MKMapView in my iOS app. I have a GPS coordinate in WGS84 format, which corresponds to a location in Hong Kong. When my device is physically located in Hong Kong, MKMapView displays the map with the "Apple Maps" label, and the WGS84 coordinate is rendered at the correct position. However, when the device is in Mainland China, MKMapView switches to display "Amap" (Gaode Maps) branding, and the same WGS84 coordinate is rendered at an incorrect position. I understand that Amap in Mainland China uses the GCJ-02 coordinate system, while Apple Maps typically uses WGS84. This discrepancy suggests a potential coordinate system mismatch, but I cannot definitively confirm which map type (and corresponding coordinate system) MKMapView is actually using in different regions. My key questions are:

  1. How can I programmatically or visually confirm the underlying map type (Apple Maps vs. Amap) and its coordinate system within MKMapView?
  2. Is there a way to simulate the Apple Maps environment for testing when physically located in Mainland China?
Answered by DTS Engineer in 855003022

CLLocationCoordinate2D is documented to use the WGS 84 reference frame. If you have specific needs to use a different coordinate system or projection with MapKit, please file an Enhancement Request so the team can consider your needs. Once you file the request, please post the FB number here.

First of all, WGS84 is a world geodetic system (WGS). It's complicated. Coordinates in MapKit are just basic latitude and longitude. Internally, they are represented as map points in the web mercator system (EPSG:3857), not WGS84.

But none of that really matters for your question. Maps in China must use the government-mandated coordinate system which automatically applies obfuscation. So, yes, it is wrong. But it's supposed to be wrong. You don't need to worry about that or try to simulate it. And definitely don't worry much about obvious edge cases like Hong Kong.

CLLocationCoordinate2D is documented to use the WGS 84 reference frame. If you have specific needs to use a different coordinate system or projection with MapKit, please file an Enhancement Request so the team can consider your needs. Once you file the request, please post the FB number here.

The current issue is not that there is a need to use a non-WGS 84 system, but rather that it is unclear what type of map MapKit is currently using.

MapKit uses CLLocationCoordinate2D as part of its API, and that class is documented as using the WGS 84 reference frame.

— Ed Ford,  DTS Engineer

First of all, never use comments for replies. Apparently they don't trigger notifications, for people who use them. But they also don't get noticed at all.

WGS 84 is a large and complex standard, among many similar large and complex standards designed for dealing with coordinates on the earth.

However, because WGS 84 is such a broad standard, it isn't going to have much practical meaning in more specific contexts like a map display. When it does have a specific meaning, it will typically have some kind of qualifier. It is usually better to refer to EPGS identifiers.

Apple Maps is a good example. The Apple Maps display uses EPGS:3857, AKA "WGS 84 / Pseudo-Mercator". But most government and professional mapping systems like ArcGIS use EPGS:4326, AKA "WGS 84". You can easily see the difference between these two systems in an image or map.

The above references to CLLocationCoordinate2d using WGS 84 is also true, but the significance there is related more to where a particular lat/long coordinate is on the earth, rather than the overall map display.

However, I don't know which interpretation is relevant for this question regarding China. China itself doesn't use WGS 84 or the EPGS system. They have their own, proprietary system that purposefully obfuscates locations on the map. China is very strict about mapping. They don't allow foreign companies, like Apple, to display maps in China. That's why Apple has to use Amap.

Why does any of this matter? What is the OP trying to determine with question #1? Is question #2 even legal? I can't answer either and I recommend just ignoring these literal "edge" cases.

If someone has a more specific need that seems like it would be 1) worth digging into and 2) legal, then maybe add a new reply instead of a comment.

Incorrect position rendering of WGS84 coordinate in MKMapView: Discrepancy between Apple Maps (Hong Kong) and Amap (Mainland China)
 
 
Q