Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-15183: Make standard technique's color modifiable at render time.
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Mandado <andres.mandado-almajano@here.com>
  • Loading branch information
atomicsulfate committed Apr 27, 2021
1 parent 943588e commit b5c7a1a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion @here/harp-datasource-protocol/lib/TechniqueDescriptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const standardTechniqueDescriptor = mergeTechniqueDescriptor<StandardTechnique>(
baseTechniqueParamsDescriptor,
{
attrDescriptors: {
color: AttrScope.FeatureGeometry,
color: { scope: AttrScope.TechniqueRendering, automatic: true },
vertexColors: { scope: AttrScope.TechniqueRendering, automatic: true },
wireframe: { scope: AttrScope.TechniqueRendering, automatic: true },
roughness: { scope: AttrScope.TechniqueRendering, automatic: true },
Expand Down
23 changes: 23 additions & 0 deletions test/rendering/StylingTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,29 @@ describe("MapView Styling Test", function () {
});
});
describe("standard technique", function () {
mapViewFeaturesRenderingTest(`polygon-dynamic-color`, {
geoJson: {
type: "FeatureCollection",
features: [rectangle1, rectangle2, referenceBackground]
},
theme: {
lights,
styles: {
geojson: [
referenceBackroundStyle,
{
when: "$geometryType == 'polygon'",
technique: "standard",
attr: {
color: ["get", "dynamic-color", ["dynamic-properties"]]
}
}
]
}
},
dynamicProperties: [{ name: "dynamic-color", value: "green" }]
});

mapViewFeaturesRenderingTest(
`polygon-standard-texture`,
{
Expand Down

0 comments on commit b5c7a1a

Please sign in to comment.