MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / updateStyle

Function updateStyle

public/iframe/lib/js/mixinsMap.js:101–154  ·  view source on GitHub ↗
(layer, keyName, value, object3Dlayer, scene)

Source from the content-addressed store, hash-verified

99 }
100 },
101 updateStyle (layer, keyName, value, object3Dlayer, scene) {
102 // 更新图层样式
103 // layer 图层 keyName 更新的key值 value 更新的值
104 if (!layer) return;
105 switch (keyName) {
106 case 'color':
107 case 'active':
108 case 'size':
109 case 'animate':
110 case 'shape':
111 {
112 layer[keyName](value)
113 // layer.color(this.option.color);
114 } break;
115 case 'enable':
116 case 'interval':
117 case 'duration':
118 case 'trailLength': {
119 layer.animate({
120 [keyName]: value,
121 })
122 }; break;
123 case 'opacity':
124 case 'strokeWidth':
125 case 'stroke':
126 case 'baseColor':
127 case 'windowColor':
128 case 'brightColor':
129 case 'baseColor':
130 case 'intensity':
131 case 'radius':
132 case 'coverage':
133 case 'angle': {
134 layer.style({
135 [keyName]: value,
136 })
137 }; break;
138 case 'selectType': {
139 layer.shape(value.default)
140 }; break;
141 case 'rampColors': {
142 layer.style({
143 rampColors: {
144 colors: value,
145 }
146 })
147 }; break
148 case 'gltf': {
149 value.map(item => {
150 this.addGITF(item.lnglat, item.selectGltf, item.config, object3Dlayer, scene)
151 })
152 }
153 }
154 },
155 addGITF (lnglat, selectGltf, config, object3Dlayer, scene) {
156 const urlDuck = `./3d/${selectGltf}/scene.gltf`;
157 const paramDuck = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected