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

update to 'Fix google map offsets in china' #72

Conversation

johnd0e
Copy link
Contributor

@johnd0e johnd0e commented Jan 19, 2019

Misc updates for #68.

fix-china-map-offset: Baidu support

...and more:

  • applied to googleMutant
  • fix filename

@johnd0e
Copy link
Contributor Author

johnd0e commented Jan 20, 2019

Todo:

  1. applied to googleMutant

    Perhaps it wasn't necessary and should be reverted.

  2. options for HongKong...

    It seems that it needed for Baidu only.
    If we could make plugin for Baidu it would have sense.
    But I'm not sure.
    (If not than this could be removed)

  3. ...and map type

    We need to test different maps.
    Perhaps this required for Google only, so condition need to be enhanced.

  4. It also possible that we do not need check 'if in China' for every Chinese map.
    Need more maps' plugins to test...
    BTW, leaflet has interesting function, that allows to simplificate our polygon, like here: http://mourner.github.io/simplify-js/

  5. (redefine leaflet methods cleaner)

    I suppose that we can make it even cleaner, not touching L.GridLayer.prototype.
    Will try tomorrow.

code/boot.js Show resolved Hide resolved
@johnd0e
Copy link
Contributor Author

johnd0e commented Jan 24, 2019

I think that better leave boot.js untouched and patch layers options in plugin setup instead.
All layers are accessible via layerChooser._layers, and it's easy to patch only _mutant layers.
Will try tomorrow.

@johnd0e
Copy link
Contributor Author

johnd0e commented Jan 25, 2019

@modos189
I need an advice.

Currently we rewrite L.TileLayer class:

  L.TileLayer.include(fixChinaOffset);

A more proper way would be to extent it with new class:

  L.TileLayer.GCG02 = L.TileLayer.extend(fixChinaOffset);

And then instead of needFixChinaOffset option we would use that new class:

var mapLayer = new L.TileLayer.GCG02 (url, options);

But I doubt that we should make things more complex here..

johndoe added 2 commits January 26, 2019 14:57
In current state it doesn't function.
Maybe someone reimplement it in future.
More info here: IITC-CE#64.
@johnd0e
Copy link
Contributor Author

johnd0e commented Jan 30, 2019

@modos189?

@johnd0e johnd0e moved this from Priority to Testing in Track features for next release Feb 1, 2019
@johnd0e johnd0e merged commit 667ecea into IITC-CE:fix-google-map-offsets-in-china Mar 10, 2019
@johnd0e johnd0e deleted the fix-google-map-offsets-in-china branch March 14, 2019 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants