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

Clean up setSize API #54

Closed
tmcw opened this issue Aug 31, 2011 · 1 comment
Closed

Clean up setSize API #54

tmcw opened this issue Aug 31, 2011 · 1 comment
Milestone

Comments

@tmcw
Copy link
Contributor

tmcw commented Aug 31, 2011

map.setSize accepts either (x, y) or ({x: 0, y: 0}) as arguments, and then it passes [{x: 0, y: 0}] to its callback. I don't grok any strong reasons why three types of representing size are necessary here - I think we should choose one (probably the size-object), and just go with that.

@RandomEtc
Copy link
Contributor

It's a bit weird that it's the only thing that allows x,y or a point, it's true! Though I see no reason to enforce that the supplied arg should be a Point when any x/y Object will do.

I'd be OK losing support for setSize(x,y) in favor of consistency with other APIs, but it would be our first API breaking change. Perhaps we should make a list of these and see if we can make a clean break to v1.0.0? I've made a start on this on the wiki: https://github.com/stamen/modestmaps-js/wiki/v1.0.0-API-proposals

Regarding the callback, we should make sure that map.dimensions is always a com.modestmaps.Point, even if a { x: 0, y: 0 } literal is passed in, and that the callback receives MM.Point accordingly.

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

No branches or pull requests

2 participants