MCPcopy Create free account
hub / github.com/Tong89/smartNode / _methodToLinkColor

Function _methodToLinkColor

frontend/app.js:812–819  ·  view source on GitHub ↗

* 根据传输方式返回对应的链路颜色(Cesium.Color)。 * - direct(直连):金黄色 * - relay(单中继):青绿色 * - multi_relay(多跳):紫色 * @param {string} method - 传输方式 * @returns {Cesium.Color}

(method)

Source from the content-addressed store, hash-verified

810 * @returns {Cesium.Color}
811 */
812 _methodToLinkColor(method) {
813 if (!window.Cesium) return null;
814 switch (method) {
815 case 'relay': return Cesium.Color.fromCssColorString('#3dcfc4'); // 青绿
816 case 'multi_relay': return Cesium.Color.fromCssColorString('#b67cf6'); // 紫色
817 default: return Cesium.Color.fromCssColorString('#f0c76b'); // 金黄(直连)
818 }
819 },
820
821 /**
822 * 按 linkKey 复用已有的 polyline 实体;不存在时新建并注册到 _linkIndex。

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected