@@ -980,14 +980,15 @@ export class StyleUtils {
980980 * @function ol.supermap.StyleUtils.getOpenlayerStyle 获取专题图对应的openlayers格式的style
981981 * @param styleParams {String} 样式参数
982982 * @param featureType {String} feature类型
983+ * @param isRank {Boolean} 是否为等级符号
983984 * @returns {Object } style对象
984985 */
985- static getOpenlayersStyle ( styleParams , featureType ) {
986+ static getOpenlayersStyle ( styleParams , featureType , isRank ) {
986987 let style ;
987988 if ( styleParams . type === "BASIC_POINT" ) {
988989 style = this . toOpenLayersStyle ( styleParams , featureType ) ;
989990 } else if ( styleParams . type === "SYMBOL_POINT" ) {
990- style = this . getSymbolStyle ( styleParams ) ;
991+ style = this . getSymbolStyle ( styleParams , isRank ) ;
991992 } else if ( styleParams . type === "SVG_POINT" ) {
992993 style = this . getSVGStyle ( styleParams ) ;
993994 } else if ( styleParams . type === 'IMAGE_POINT' ) {
@@ -1001,7 +1002,7 @@ export class StyleUtils {
10011002 * @param {object } parameters - 样式参数
10021003 * @returns {Object } style对象
10031004 */
1004- static getSymbolStyle ( parameters ) {
1005+ static getSymbolStyle ( parameters , isRank ) {
10051006 let text = '' ;
10061007 if ( parameters . unicode ) {
10071008 text = String . fromCharCode ( parseInt ( parameters . unicode . replace ( / ^ & # x / , '' ) , 16 ) ) ;
@@ -1013,10 +1014,12 @@ export class StyleUtils {
10131014 let strokeColor = StyleUtils . hexToRgb ( parameters . strokeColor ) ;
10141015 strokeColor . push ( parameters . strokeOpacity ) ;
10151016
1017+ let fontSize = isRank ? 2 * parameters . radius + "px" : parameters . fontSize ;
1018+
10161019 return new ol . style . Style ( {
10171020 text : new ol . style . Text ( {
10181021 text : text ,
1019- font : parameters . fontSize + " " + " supermapol-icons",
1022+ font : fontSize + " supermapol-icons" ,
10201023 placement : 'point' ,
10211024 textAlign : 'center' ,
10221025 fill : new ol . style . Fill ( {
0 commit comments