Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

mock queryRenderedFeatures #5

Merged
merged 3 commits into from
Jun 23, 2016
Merged

Conversation

mcwhittemore
Copy link
Contributor

@mcwhittemore mcwhittemore commented Jun 21, 2016

adds simple user based mocking for queryRenderedFeatures.

@mcwhittemore
Copy link
Contributor Author

@davidtheclark can you give this a review?

features: [feature]
});
var merged = turfUnion(fpoly, bpoly);
return merged.geometry.type === 'Polygon';

Choose a reason for hiding this comment

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

I do not understand what is happening with the envelope, union, and filtering out non-Polygons. Could you explain?

@mcwhittemore
Copy link
Contributor Author

@davidtheclark reading the code over, removing envelope should make this a more accurate mock. I have rewritten this and added a handful of comments to try and explain what is going on.

@davidtheclark
Copy link

Cool, looks good. If it's working the way you intend in your Draw tests, then merge away.

@mcwhittemore mcwhittemore merged commit e9f8229 into master Jun 23, 2016
@mcwhittemore mcwhittemore deleted the mock-query-rendered-features branch June 23, 2016 16:28
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.

None yet

2 participants