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

Use meters as size scale in IconLayer and TextLayer #2810

Merged
merged 3 commits into from Mar 22, 2019

Conversation

Projects
None yet
3 participants
@xintongxia
Copy link
Contributor

xintongxia commented Mar 18, 2019

For deck.gl 7.0 API audit

  • getSize return size in meters (replace size in pixels)
  • Add sizeMinPixels and sizeMaxPixels
  • Fix IconLayer and TextLayer examples

Problems:
Change size to meters from pixels is breaking change, the old examples that use IconLayer are not working. I manually get the initial viewport parameter metersPerPixel and calculate the size in meters to match the original example. There are more examples I haven't changed yet. But is there other better way to make old examples work? Also other people whoever use IconLayer will be impacted by this change.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Mar 18, 2019

Coverage Status

Coverage increased (+0.3%) to 59.247% when pulling 10a7243 on xx/text-layer-fix into 76291a0 on master.

Show resolved Hide resolved examples/experimental/bezier/src/bezier-graph-layer.js Outdated
Show resolved Hide resolved examples/layer-browser/src/examples/core-layers.js Outdated
Show resolved Hide resolved examples/layer-browser/src/examples/core-layers.js Outdated
Show resolved Hide resolved examples/website/icon/app.js Outdated
Show resolved Hide resolved examples/website/icon/app.js Outdated
Show resolved Hide resolved examples/website/icon/icon-cluster-layer.js Outdated
Show resolved Hide resolved ...s/layers/src/text-layer/multi-icon-layer/multi-icon-layer-vertex.glsl.js Outdated
Show resolved Hide resolved modules/layers/src/text-layer/text-layer.js Outdated
Show resolved Hide resolved test/render/test-cases.js Outdated

@SymbolixAU SymbolixAU referenced this pull request Mar 19, 2019

Closed

Text Layer changes #139

@xintongxia xintongxia force-pushed the xx/text-layer-fix branch from c046218 to b786bfe Mar 19, 2019

Show resolved Hide resolved test/render/test-cases.js Outdated

xintongxia added some commits Mar 18, 2019

Use meters as size scale in IconLayer and TextLayer
remove unnecessary changes

change doc

use reasonable sizeScale for text-layer and icon-layer examples and tests

Add sizeUnits option

convert meters to pixels uniform in layer

@xintongxia xintongxia force-pushed the xx/text-layer-fix branch from 3cdce8d to f53e563 Mar 22, 2019

@@ -50,12 +52,19 @@ vec2 rotate_by_angle(vec2 vertex, float angle) {
void main(void) {
vec2 iconSize = instanceIconFrames.zw;
// convert size in meters to pixels, then scaled and clamp
float sizeScalePixels = clamp(

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 22, 2019

Contributor

Nit: call it sizePixels as it's not a scale

@@ -56,13 +58,20 @@ vec2 rotate_by_angle(vec2 vertex, float angle) {
void main(void) {
vec2 iconSize = instanceIconFrames.zw;
// convert size in meters to pixels, then scaled and clamp
float sizeScalePixels = clamp(

This comment has been minimized.

Copy link
@Pessimistress

Pessimistress Mar 22, 2019

Contributor

Ditto

@xintongxia xintongxia merged commit e1514a0 into master Mar 22, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@xintongxia xintongxia deleted the xx/text-layer-fix branch Mar 22, 2019

ajduberstein added a commit to ajduberstein/deck.gl that referenced this pull request Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.