-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support maptiles based on GCJ02 (Chinese) #64
Comments
There are currently two attempts to fix the problem.
|
Some links from former discussion:
|
@modos189 could you explain the reason for this change: 6d3e284? Also I'm interesting what is the source of transforming algorithm.
And here are also different 'point-in-polygon' algorithm implementations: #65 (comment) |
Previously, the fix coordinates included most of India, all of South and North Korea, the Philippines, Vietnam, Mongolia, Thailand, and a number of other countries: Code in 6d3e284 more accurately indicates the borders of China, so as not to affect other countries. I took it here: iitc-project/ingress-intel-total-conversion#1188 |
Here I managed to partially solve the problem. BIG plus 1: Do not change the coordinates of portals Minus: The fact is that due to the correction of coordinates the map moves and goes beyond the boundaries for which the tiles are loaded. By the way, now the correction of coordinates applies to all maps (except satellite and hybrid) |
Is it possible to provide this solution to other basemap-plugins?
So there is complex polygon now. Doesn't it affect the performance? Or maybe better make 2-steps check?
Do you have ideas how to fix it? |
Well, I see that the source is mentioned in that PR:
So I wonder why these lines were removed? P.S. |
Yep, that's what I want to do.
Visually, I do not notice the difference.
I don't know what that is. And it's not used anywhere.
I fixed this in all maps except Google. Now I do not know how to fix
Mistakenly deleted. Now returned. |
I found error in the code (mistype). Also I have concerns about some style's elements. |
Since there are both maps that require coordinate correction and those that do not require it, I suggest pass an optional parameter when initializing the map.
|
I found a solution to fix google maps |
I would be perfect solution. But I still have concerns about leaflet monkey-patching in |
We need to make here a list of known maptiles providers, in order to check:
Even more, we need 2 lists: first for providers included with iitc, and second for all others. |
Included:
|
Chinese:
Others:
|
@johnd0e |
There could be difference depending on map. In current code (#72) HK positions are also processed for Baidu map.
We also need to check all their variations (incl. satellite/hybrid).
According Wikipedia Here are also in GSJ02. Could you check it? |
Too complicated? I think we can use gedo-map + fix-china-map-gcj02-offset in China. Otherwise, we can use Google map directly without fix-china-map-gcj02-offset. We don't use baidu-map (bd09), and now baidu-map can't be displayed in intel. |
We fix-china-map-offset for Google, don't we?
How have you got this screen? |
yes, but if I have gaode map in china, why use google map? google map update is not in timely, In China, gaode map is enough.
I used the same method as gaode map, but it didn't display correctly. |
Ok. And what is difference between 'gaode' and 'autonavi'?
May be this can help: https://github.com/muyao1987/leaflet-tileLayer-baidu |
gaode=autonavi ^^
ok |
Interesting, there is official converting api: |
May be to use 2 parameters in which to pass a list of layers that need correction? |
As I stated here #72 (comment), we need to test some real maps before we could make proper decisions.
|
In current state it doesn't function. Maybe someone reimplement it in future. More info here: IITC-CE#64.
* Modify "China" boundary for offset fix plugin iitc-project/ingress-intel-total-conversion#1188 #2 * Update Fix Google Map offsets in China to GoogleMutant. But not working =( The plugin changes coordinates, but the change is not applied * An example of a working solution. Described in more detail in a task #64 * Smooth operation with map, fixed get map options, fixed download of map tiles (except Google maps) * fix-googlemap-china-offset: fix style issues lint: * `let` is not in es5 * 'HK_LENGTH' is assigned a value but never used * 'original' is defined but never used style: * == vs === * Mixed spaces and tabs * fix indents, missed/extra/trailing spaces, missed semi * Fix offset in Google maps * Rename to fix-china-offset.user.js * Edited the documentation, because now plugin works not only in Google maps * fix-googlemap-china-offset: refactoring divide PRCoords into 2 distinct functions: * plugin.fixChinaOffset.isInGoogle * plugin.fixChinaOffset.gcjObfs added stub for old fix-googlemap-china-offset plugin * fixup! fix-googlemap-china-offset: refactoring * Revert changes in Leaflet.GoogleMutant.js * Rename fix-china-offset -> fix-china-map-offset * Previous indent returned * Update plugins/fix-china-map-offset.js Co-Authored-By: modos189 <[email protected]> * Update plugins/fix-china-map-offset.js Co-Authored-By: modos189 <[email protected]> * Update plugins/fix-china-map-offset.js Co-Authored-By: modos189 <[email protected]> * fix-china-map-offset: Baidu support * Sources refactored to be closer to upstream https://github.com/Artoria2e5/PRCoords * Baidu support * Clarify comment about usage * fix-china-map-offset: appied to googleMutant * fix-china-map-offset: fix filename * fix-china-map-offset: fixme: options for HongKong and map type * fixup! fix-china-map-offset: fixme: options for HongKong and map type * fix-china-map-offset: refactor (intermediate function eliminated) * fix-china-map-offset: refactor (redefine leaflet methods cleaner) * fix-china-map-offset: cosmetics (restore original source indents) * fix-china-map-offset: change leaflet extending do not touch L.GridLayer extend L.TileLayer and L.GridLayer.GoogleMutant * fix-china-map-offset: set 'needFixChinaOffset' option in boot.js * fix-china-map-offset: fix: put actions into setup function * fix-china-map-offset: patch GoogleMutant in plugin completely (not in boot.js) * fixup! fix-china-map-offset: cosmetics (restore original source indents) * fix-china-map-offset: remove Baidu-stuff In current state it doesn't function. Maybe someone reimplement it in future. More info here: #64. * fix-china-map-offset: shorten 'namespace' access * fix-china-map-offset: fix: L.Util may not be available yet * fix-china-map-offset: fix: namespace conflict
Fixed by #68 |
Background info:
Summary: some map tiles providers use GCJ-02 coordinates, thus map appears with some offset.
Originally posted by @modos189 in https://github.com/_render_node/MDExOlB1bGxSZXF1ZXN0MjQ0Njc3OTI3/pull_requests/unread_timeline#issuecomment-454773564
The text was updated successfully, but these errors were encountered: