| | |
| | | switch (shape) { |
| | | case 'Point': |
| | | const pSize = themeStyle?.PSIZE ?? feature.get('psize'); |
| | | if (!pSize) return null; |
| | | |
| | | const pcolor = themeStyle?.PCOLOR ?? feature.get('pcolor'); |
| | | const pkey = `${pSize}_${pcolor}`; |
| | | |
| | | if (!styleMap.junction[pkey]) { |
| | | styleMap.junction[pkey] = new Style({ |
| | | image: new Circle({ |
| | | radius: pSize, |
| | | fill: new Fill({ color: `#${pcolor}` }), |
| | | // fill: new Fill({ color: `blue` }), |
| | | }), |
| | | const pStyle = themeStyle?.PSTYLE ?? feature.get('pstyle'); |
| | | |
| | | const pointStyle = props.olMap?.getPointStyles({ |
| | | size: pSize, |
| | | color: pcolor, |
| | | style: pStyle, |
| | | }); |
| | | } |
| | | |
| | | // const textStyle = createTextStyle(feature, resolution); |
| | | styles.push(styleMap.junction[pkey]); |
| | | pointStyle && styles.push(pointStyle); |
| | | break; |
| | | case 'LineString': |
| | | const lSize = themeStyle?.LSIZE ?? feature.get('lsize'); |
| | | if (!lSize) return null; |
| | | const lColor = themeStyle?.LCOLOR ?? feature.get('lcolor'); |
| | | const lKey = `${lSize}_${lColor}`; |
| | | if (!styleMap.pipe[lKey]) { |
| | | styleMap.pipe[lKey] = new Style({ |
| | | // image: new Circle({ |
| | | // radius: lsize, |
| | | // fill: new Fill({ color: `#${color}` }), |
| | | // }), |
| | | stroke: new Stroke({ |
| | | color: `#${lColor}`, |
| | | width: lSize, |
| | | }), |
| | | const lStyle = themeStyle?.LSTYLE ?? feature.get('lstyle'); |
| | | |
| | | const lineStyle = props.olMap?.getLineStyles({ |
| | | lsize: lSize, |
| | | lcolor: lColor, |
| | | lstyle: lStyle, |
| | | }); |
| | | } |
| | | styles.push(styleMap.pipe[lKey]); |
| | | lineStyle && styles.push(...lineStyle); |
| | | |
| | | break; |
| | | case 'Polygon': |
| | | break; |
| | |
| | | // } |
| | | //#region ====================== 添加标注 ====================== |
| | | const tString = themeStyle?.TSTRING ?? feature.get('tstring'); |
| | | if (tString) { |
| | | const textStyle = createTextStyle(feature, resolution); |
| | | styles.push(textStyle); |
| | | } |
| | | const tStringStyle = props.olMap?.getLabelStyles({ |
| | | textContent: tString, |
| | | resolution, |
| | | }); |
| | | tStringStyle && styles.push(tStringStyle); |
| | | //#endregion |
| | | |
| | | return styles; |
| | |
| | | const legends = await changeTheme(ids); |
| | | legendList.value = parseLegends(legends); |
| | | }; |
| | | |
| | | |
| | | watch( |
| | | () => themeInfo.value, |