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

Add anchorLineColor to Cesium3DTileStyle #5295

Merged

Conversation

oterral
Copy link

@oterral oterral commented May 9, 2017

Allow to modify the color of the anchor line via the style.

* @default {@link Material.ColorType}
*/
material : {
//var polyline = this._polylineCollection.get(this._batchId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented out code.

return polyline.material;
}

if (!defined(this._material)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no polyline, just return undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

And also remove _material above.

*
* @default {@link Material.ColorType}
*/
material : {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of material, why not anchorLineColor? Polylines have a color material by default. You can get/set polyline.material.uniforms.color. If a polyline does not exist, return undefined or do nothing.

return this._anchorLineColor;
},
set : function(value) {
this._backgroundColor = value;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be setting this._anchorLineColor.

@@ -136,6 +138,10 @@ define([
feature.backgroundYPadding = style.backgroundYPadding.evaluate(frameState, feature);
feature.backgroundEnabled = style.backgroundEnabled.evaluate(frameState, feature);

// Create a color material with fromType:
feature.material = Material.fromType('Color');
Copy link
Contributor

Choose a reason for hiding this comment

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

With the anchorLineColor property suggestion above, this would become:

if (defined(feature.anchorLineColor)) {
    feature.anchorLineColor = style.anchorLineColor.evaluateColor(frameState, feature);
}

@bagnell
Copy link
Contributor

bagnell commented May 9, 2017

Is anchor line the most common term for these types of lines? I've also heard drop lines and extruded lines.

@pjcozzi
Copy link
Contributor

pjcozzi commented May 9, 2017

@oterral or @bagnell please also update the spec in CesiumGS/3d-tiles#124 when this is finalized.

@pjcozzi
Copy link
Contributor

pjcozzi commented May 9, 2017

@oterral can you please add yourself to CONTRIBUTORS.md and send in a Contributor License Agreement (CLA) if we don't already have one?

@bagnell
Copy link
Contributor

bagnell commented May 10, 2017

@pjcozzi We have a CLA and @oterral is listed in CONTRIBUTORS.md. I'll update the spec when we finalize the style. I imagine there will be significant changes. We should discuss with @lilleyse.

@pjcozzi
Copy link
Contributor

pjcozzi commented May 10, 2017

Ah right, I missed the CLA. OK, please discuss with @lilleyse; I might not be available tomorrow.

@oterral
Copy link
Author

oterral commented May 11, 2017

Thx for the review. I will make the changes according to comments.

@oterral
Copy link
Author

oterral commented May 11, 2017

@bagnell do you have a preference for the name ? I can change to dropLineColor if you prefer.

@bagnell
Copy link
Contributor

bagnell commented May 11, 2017

I don't have a preference. I was just wondering if there was a commonly used name. If not, stick with anchorLine.

@oterral oterral force-pushed the vector-tiles-labels-translu branch 2 times, most recently from 3b39922 to ccfce64 Compare May 15, 2017 07:24
@oterral
Copy link
Author

oterral commented May 15, 2017

PR updated . I'm not sure if the build failure is related to this PR.

@bagnell
Copy link
Contributor

bagnell commented May 16, 2017

Thanks @oterral! I made some small tweaks in bd3ea99, otherwise this looks good to me.

@bagnell bagnell merged commit 6cf4f3f into CesiumGS:vector-tiles-labels May 16, 2017
@oterral oterral deleted the vector-tiles-labels-translu branch May 17, 2017 06:43
@pjcozzi
Copy link
Contributor

pjcozzi commented May 18, 2017

Thanks again @oterral!

@bagnell did you make the spec updates?

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.

3 participants