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

Many setters have implicit assumptions of state. #3

Open
mbostock opened this issue Aug 2, 2010 · 4 comments
Open

Many setters have implicit assumptions of state. #3

mbostock opened this issue Aug 2, 2010 · 4 comments
Labels

Comments

@mbostock
Copy link
Contributor

mbostock commented Aug 2, 2010

For example:

  • arrow.map cannot be changed after initially set (or set to null).
  • map.container cannot be changed after initially set (or set to null).
  • map.container must be set before adding anything to the map.
  • layer.id cannot be changed after the layer is added to the map.
  • layer.size cannot be changed after tiles are loaded.
  • layer.zoom cannot be changed after tiles are loaded.
  • image.url cannot be changed after tiles are loaded.
  • ... etc.

Ideally, all of these should be changed to allow objects to be reconfigured independent of whatever state they are currently in. If that is not possible, the limitations should be clearly documented and an error should be thrown.

@mbostock
Copy link
Contributor Author

Some of these were fixed in 2.0.3, but not all.

@mbostock
Copy link
Contributor Author

mbostock commented Sep 7, 2010

The layer.id restriction was fixed in 2.1.0.

@mbostock
Copy link
Contributor Author

mbostock commented Sep 8, 2010

More fixes in this commit:

http://github.com/mbostock/polymaps/commit/0cfd05321bffb7492b83db73314c58eef32a3b9b

I think the remaining stateful bugs are limited to:

  • map.tileSize
  • map.container
  • geoJson.clip

There's also the issue that url.template and url.hosts can't be changed after add, unless you re-assign the url property on the given layer, or call layer.reload() manually. But I think that's fine.

@mbostock
Copy link
Contributor Author

And geoJson.clip is now fixed:

http://github.com/mbostock/polymaps/commit/692eb1c45647c4bec8e9dfd1bf2c7d73a4b7e95f

I think the last two will be part of the 3.0 release, since the change from container to parent won't be totally backwards-compatible.

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

1 participant