-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add a d3 quadFeature #581
Add a d3 quadFeature #581
Conversation
This will render nearly identically to the gl quadFeature, with the exception that when an image quad is not a parallelogram. When the quad is not a parallelogram, the gl renderer will skew the image using two different transforms making the quad contain the full image, but with a transform discontinuity along one of the diagonals. The d3 render will skew the image with a single transform, and part of the image will not be visible. For not convex quads, the d3 renderer could display part of the image multiple times.
Switch to using svg image elements. These are always parallelograms, so quads that are convex may not have their full areas covered, and quads that are not parallelograms will have extra areas rendered.
Percolate a reference for each tile to the canvas element to make it easier to debug and test. Use floats for the null renderer so that its tiles will be located at close to the same position as svg tiles. Reenable the one disabled test for null renderer tiles.
Remove some code that is no longer used.
Current coverage is 74.00%@@ master #581 diff @@
==========================================
Files 82 83 +1
Lines 7216 7300 +84
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 5276 5402 +126
+ Misses 1940 1898 -42
Partials 0 0
|
I've added a config file for jsdoc so that the class names show the long name. This makes it so instead of seeing four quadFeature in the table of contents, you now see geo.quadFeature, geo.gl.quadFeature, geo.canvas.quadFeature, and geo.d3.quadFeature. I fixed a few other minor jsdoc issues. I also added a build-examples script to package.json.
I had one of the tests fail twice on my system and this fixes it.
@@ -70,6 +70,7 @@ | |||
}, | |||
"scripts": { | |||
"build": "webpack --config webpack.config.js && webpack --config external.config.js", | |||
"build-examples": "webpack --config webpack-examples.config.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Not directly related to this branch: I am having issues with data:
|
You probably need to compile cmake with SSL support. |
thanks @jbeezley didn't have this issue before. Is it because we switched to https on data recently? |
that was indeed the problem, my cmake was built without openssl. |
Also, use integer transforms for the svg tile layer where appropriate. Only compare the positions of the top-most level, as lower levels are increasingly offset.
parseInt casts to a string and then converts to an integer (at least in Chrome), so values like 8e-14 convert to 8, not 0.
Drawing features was moved inside a requestAnimationFrame. Removing features also needs to be there or the dynamicData example doesn't work.
Yup, LGTM. |
This will render similar to the gl quadFeature, with the exception that when an image quad is not a parallelogram, the image is still drawn as one. The gl renderer skews an image using two different transforms making the quad contain the full image, but with a transform discontinuity along one of the diagonals when the quad is not a parallelogram. The d3 render will skew the image with a single transform, and non-parallelograms will be render somewhat incorrectly.
Initially, this was implemented with polygons for both color quads and image quads, but polygons using images have to use
defs
to define an svg pattern, and were substantially slower than using images (one virtue of using polygons is that non-parallelogram quads were rendered with the correct area, though the image was still incorrectly transformed).The d3 tile layer has been switched to use the quad feature. This is slightly faster than using the plane feature (perhaps a 10% speed up), but still much slower than canvas or gl.
The quad tests were dropped when the webpack refactor was done. They have been added back in.