/** * 单个台风对象 * @class Typhoon */ class Typhoon { //========== 构造方法 ========== constructor(options, map) { this.options = options; this.map = map; //创建台风相关矢量图层 this.typhoonLayer = new mars3d.layer.GraphicLayer(); map.addLayer(this.typhoonLayer); this.clickPtLayer = new mars3d.layer.GraphicLayer(); map.addLayer(this.clickPtLayer); this.showTyphoonToMap(options.path); } //========== 对外属性 ========== //显示隐藏 get show() { return this.options.show; } set show(val) { this.options.show = val; this.typhoonLayer.show = val; this.clickPtLayer.show = val; } getPointById(id) { return this.typhoonLayer.getGraphicById(id); } flyTo(options) { this.typhoonLayer.flyTo(options); } getPointTooltip(event, isYB) { let item = event.graphic?.attr; if (!item) { return; } let ybHtml = ""; if (isYB) { ybHtml = `
预报机构: 中央气象台
`; } let fqHtml = '风圈半径 | 东北 | 东南 | 西南 | 西北 |
---|---|---|---|---|
七级 | ${item.circle7.radius1} | ${item.circle7.radius2} | ${item.circle7.radius3} | ${item.circle7.radius4} (KM) |
十级 | ${item.circle10.radius1} | ${item.circle10.radius2} | ${item.circle10.radius3} | ${item.circle10.radius4} (KM) |
十二级 | ${item.circle12.radius1} | ${item.circle12.radius2} | ${item.circle12.radius3} | ${item.circle12.radius4} (KM) |
${this.options.typnumber} ${this.options.name_cn}
过去时间: ${item.time_str}
中心位置: ${item.lat}N/${item.lon}E
最大风速: ${item.centerSpeed}米/秒
中心气压: ${item.strength}百帕
移动方向: ${item.moveTo_str}
移动速度: ${item.windSpeed}公里/小时