Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent coordinate system #186

Open
bylh opened this issue Mar 27, 2018 · 1 comment
Open

Inconsistent coordinate system #186

bylh opened this issue Mar 27, 2018 · 1 comment

Comments

@bylh
Copy link

bylh commented Mar 27, 2018

Hi, I found a problem of the coordinate system when using the plugin, I pass standard latitude and longitude coordinates, but there is a certain offset in the position displayed on the gaode maps(amap) and apple maps, this is mainly due to gaode maps and apple maps in china using the GCJ-02 system coordinates, not the WGS84 system coordinates,for gaode maps we can pass a default parameter & dev=1 for automatic conversion itself, "https://lbs.amap.com/api/amap-mobile/guide/ios/route", there is no corresponding parameter setting is found for apple maps, maybe need to convert outside.
Of course, these coordinates can be converted externally. A better way is to unify the interface and do the internal conversion as much as possible . Is it possible? Thanks.

@dpa99c
Copy link
Owner

dpa99c commented Mar 28, 2018

The plugin would have to know that the input address/coordinates refer to China in order to know whether to convert WGS84 coordinates to GCJ-02. So it would need some geofencing data to outline China and know that the coordinates need translating. Also, if the input is an address and the app being launched doesn't support address input (such as Amap), then the plugin will attempt to geocode the address to coordinates using a native geocoding service. The plugin would need to know if the returned coordinates are in WGS84 or have already been adjusted to GCJ-02.

I also presume that this is dependent on which app is being launched? Does every app supported by this plugin default to using GCJ-02 when the coordinates refer to China? If not, the plugin would need to maintain a list of which apps do and don't use GCJ-02.

So I think there would be quite a bit of complexity for the plugin to automatically handle the translation of coordinates between coordinate systems specifically for China.
However, if you're willing to implement it, I'm prepared to accept a Pull Request which does so 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants