-
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
fix-googlemap-china-offset: fix style issues #65
fix-googlemap-china-offset: fix style issues #65
Conversation
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
And there is still error in
So |
I suppose this also should be fixed adding something like |
Please update PR to new commit |
No, it is propagated back. This is a bug in es linter, or browser? |
You are right. I suppose bug in
And please comment about this:
Was it really unused argument? |
Here, indeed, unused variable. I tried calling original method as in other cases, but then errors occur when calling class Bounds |
Merged (need to test again). And I am going to review the code one more time. |
Method isInGoogle can be completely removed. It is not used |
As I can see it is used as fast precheck if latlng is in bounds of square, which covering China. |
But why? The plugin still needs to be installed separately for those from China. |
Perhaps for those who are not China, but still want to see real map offset while browsing China. Could you make some tests comparing performance between these two functions? |
BTW, here is another implementation of same pnpoly-algorithm: https://github.com/substack/point-in-polygon / https://github.com/iominh/point-in-polygon-extended And here is improved version: https://github.com/mikolalysenko/robust-point-in-polygon And here is different algorithm: https://stackoverflow.com/a/36070256/2520247.
And even more: https://libraries.io/search?keywords=points%2Cpolygon&languages=JavaScript&q=Point+polygon&sort=latest_release_published_at |
I'm confused. Method isInGoogle is used. It as roughly and thoroughly checked the coordinates. Another thing is that there is no need to make it public. |
Well, it could be useful for someone, who wants to reuse this function. |
Um. Well, maybe as two distinct functions |
I failed to identify the source of obfuscation algorithm in our code. So it's sort a mess... I'm prefer that policy about external sources (and images) should be included unmodified (and inlined only in build-process). |
Agree, as there are 2 distinct action, and there are several methods to do every of them. |
Parent issue: #64 |
lint:
let
is not in es5style: