MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getCustomSettingColors

Method getCustomSettingColors

src/openlayers/mapping/WebMap.js:3643–3659  ·  view source on GitHub ↗
(customSettings, featureType)

Source from the content-addressed store, hash-verified

3641 }
3642
3643 getCustomSettingColors(customSettings, featureType) {
3644 const keys = Object.keys(customSettings);
3645 const colors = [];
3646 keys.forEach((key) => {
3647 //兼容之前自定义只存储一个color
3648 if (Util.isString(customSettings[key])) {
3649 colors.push(customSettings[key]);
3650 return;
3651 }
3652 if (featureType === 'LINE') {
3653 colors.push(customSettings[key].strokeColor);
3654 } else if (customSettings[key].fillColor) {
3655 colors.push(customSettings[key].fillColor);
3656 }
3657 });
3658 return colors;
3659 }
3660
3661 getUniqueColors(colors, valuesLen) {
3662 return ColorsPickerUtil.getGradientColors(colors, valuesLen);

Callers 1

getUniqueStyleGroupMethod · 0.95

Calls 2

forEachMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected