Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[node] Revert semantics of Map#render #7098

Merged
merged 3 commits into from
Nov 17, 2016
Merged

[node] Revert semantics of Map#render #7098

merged 3 commits into from
Nov 17, 2016

Conversation

jfirebaugh
Copy link
Contributor

Revert node Map#render API to "stateless" camera semantics: the center, zoom, bearing, and pitch passed are what is used to render, with defaults for unspecified values.

For the test-suite implementation, which wants stateful semantics, track the camera options manually. Also, change the implementation of Map#render so that it avoids calling setCenter, etc. when the value is not changing. (Internally, setCenter does not short-circuit, so it could cause undesired updates.)

cc @mikemorris

@mention-bot
Copy link

@jfirebaugh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kkaefer, @mikemorris and @ansis to be potential reviewers.

@@ -66,6 +71,15 @@ module.exports = function (style, options, callback) {
wait();

} else {
// Ensure that the next `map.render(options)` does not overwrite this change.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a check for setPitch be necessary here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required by test-suite yet, but might as well. ✅

@jfirebaugh jfirebaugh merged commit 5c7aeec into master Nov 17, 2016
@jfirebaugh jfirebaugh deleted the revert-node-api branch November 17, 2016 22:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants