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

Create layers based on a list of features. #590

Merged
merged 5 commits into from
Jun 24, 2016

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 9, 2016

Currently, if you want to use a feature, you need to know what renderers in works in and manually check if those renderers are available on the current platform. If the renderer isn't available, we fall back to the null renderer, which is only useful for the tile layers.

With this change, you can ask for a new layer based on the features you want. If there are any renderers available that support all of the listed features, that renderer will be used. Furthermore, there is now an inherent preference in renderers in the order vgl -> canvas -> d3 -> null, so we'll fall back to a better renderer than the null renderer in many instances.

Features can have capabilities. For instance, the quad feature is only fully implemented in the vgl renderer. Image quads are mostly implemented in the d3 and canvas renderers (when the quad is a parallelogram). Color quads are implemented in the d3 renderer. If you ask for a layer that supports {features: ['quad']}, you could get any of the vgl, d3, or canvas renderers (based on the support of that renderer). If you ask for {features: ['quad.clr']}, you will only get either the vgl or d3 renderer. If you ask for {features: ['quad.img-full']}, only vgl will do.

Many examples have been updated to use this. This means that some examples will now work on more platforms (since they would only work if you have vgl, but now will work in other cases).

@codecov-io
Copy link

codecov-io commented Jun 9, 2016

Current coverage is 76.42%

Merging #590 into master will increase coverage by 0.19%

@@             master       #590   diff @@
==========================================
  Files            82         82          
  Lines          7219       7274    +55   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           5503       5559    +56   
+ Misses         1716       1715     -1   
  Partials          0          0          

Powered by Codecov. Last updated by c0429f3...5f41066

@aashish24
Copy link
Member

🎉 will complete my review tomorrow but I liked what I reviewed so far

@manthey manthey mentioned this pull request Jun 16, 2016
'feature',
{
renderer: 'vgl'
features: ['choropleth']
Copy link
Member

Choose a reason for hiding this comment

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

+1

@aashish24
Copy link
Member

Mostly looks great 😋 to me but I have one suggestion for discussions.

@aashish24
Copy link
Member

LGTM 🎉

@aashish24
Copy link
Member

@manthey should we go ahead and merge it?

@jbeezley
Copy link
Contributor

LGTM

@jbeezley jbeezley merged commit 5f16176 into master Jun 24, 2016
@jbeezley jbeezley deleted the select-renderer-by-feature branch June 24, 2016 17:06
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

Successfully merging this pull request may close these issues.

4 participants