Replace loadGeometry() with a geometry getter#34
Closed
jfirebaugh wants to merge 2 commits intomasterfrom
Closed
Conversation
Member
|
I think we should add caching if we want to make this change, since otherwise it would be easy to misuse — people don't expect a simple property access to be very computationally intensive (in this case, reparsing the whole geometry from scratch), and I'm divided on this change generally. And it's still as easy to substitute on the testing side: feature.loadGeometry = function () { return mockGeometry; }; |
Member
|
@jfirebaugh with VT spec 2.0 released, let's move on this PR. Two options to go forward:
I'm fine with either but prefer the latter option since it's more explicit. |
Member
|
Stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since we're talking about a major version bump for #33, I'd like to propose this API change as well. Replacing
loadGeometry()with ageometryproperty will make it easier, for testing purposes, to substitute a plain old JS object where aVectorTileFeaturewould normally be used.In addition, we have the option of caching the generated geometry internally if we later think that makes sense, without changing the API or ending up with a misleading method name.