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

Remove provider specific functions from mxn.js #308

Open
dezfowler opened this issue Dec 4, 2013 · 3 comments
Open

Remove provider specific functions from mxn.js #308

dezfowler opened this issue Dec 4, 2013 · 3 comments
Labels
Milestone

Comments

@dezfowler
Copy link
Member

mxn.js has some provider specific functions that should probably be either moved into the appropriate provider file or removed all together.

convertLatLonXY_Yahoo
getDegreesFromGoogleZoomLevel
getGoogleZoomLevelFromDegrees

@vicchi
Copy link
Member

vicchi commented Dec 4, 2013

The presence of convertLatLonXY_Yahoo is an anachronism left over from obsoleting support for the Yahoo! API. Given that that API is now firmly in the Dead Pool, I'll remove this call from the code base.

Where getDegreesFromGoogleZoomLevel and getGoogleZoomLevelFromDegrees are concerned, my gut feel is that we shouldn't move these into the Google provider implementation as they will then be specific to that provider and that provider only. This seems to run counter to the overall "write the code once and change provider with just two lines of code" ethos of Mapstraction.

They could live in mxn.core.js if the basic algorithm is constant across providers. I haven't checked but somehow I doubt it. I'll take a look at how the other providers calculate this and then see whether this is something we can support across all providers, or even have it implemented in Google and simply a no-op, unimplemented call in the other providers.

In the meantime, this is now part of the Release 3.0 milestone, so it doesn't get forgotten.

vicchi added a commit that referenced this issue Dec 4, 2013
@dezfowler
Copy link
Member Author

Sorry, I wasn't clear. I didn't mean expose them publicly as part of the provider, I mean't that if they're being used in the Google provider code they should just be private functions in that code somewhere.

@vicchi
Copy link
Member

vicchi commented Dec 4, 2013

In that case they can probably be obsoleted entirely. Neither getDegreesFromGoogleZoomLevel or getGoogleZoomLevelFromDegrees are referenced in the Google v3 provider implementation (nor in the old Google v2 provider implementation either). The only place they live is in mxn.js.

Furthermore, if you look at the comments around line 427, both these function make an assumption about the relationship of zoom level to pixels to degrees.

It's looking more and more like these can just be made to go away.

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

No branches or pull requests

2 participants