@@ -980,14 +980,15 @@ export class StyleUtils {
980
980
* @function ol.supermap.StyleUtils.getOpenlayerStyle 获取专题图对应的openlayers格式的style
981
981
* @param styleParams {String} 样式参数
982
982
* @param featureType {String} feature类型
983
+ * @param isRank {Boolean} 是否为等级符号
983
984
* @returns {Object } style对象
984
985
*/
985
- static getOpenlayersStyle ( styleParams , featureType ) {
986
+ static getOpenlayersStyle ( styleParams , featureType , isRank ) {
986
987
let style ;
987
988
if ( styleParams . type === "BASIC_POINT" ) {
988
989
style = this . toOpenLayersStyle ( styleParams , featureType ) ;
989
990
} else if ( styleParams . type === "SYMBOL_POINT" ) {
990
- style = this . getSymbolStyle ( styleParams ) ;
991
+ style = this . getSymbolStyle ( styleParams , isRank ) ;
991
992
} else if ( styleParams . type === "SVG_POINT" ) {
992
993
style = this . getSVGStyle ( styleParams ) ;
993
994
} else if ( styleParams . type === 'IMAGE_POINT' ) {
@@ -1001,7 +1002,7 @@ export class StyleUtils {
1001
1002
* @param {object } parameters - 样式参数
1002
1003
* @returns {Object } style对象
1003
1004
*/
1004
- static getSymbolStyle ( parameters ) {
1005
+ static getSymbolStyle ( parameters , isRank ) {
1005
1006
let text = '' ;
1006
1007
if ( parameters . unicode ) {
1007
1008
text = String . fromCharCode ( parseInt ( parameters . unicode . replace ( / ^ & # x / , '' ) , 16 ) ) ;
@@ -1013,10 +1014,12 @@ export class StyleUtils {
1013
1014
let strokeColor = StyleUtils . hexToRgb ( parameters . strokeColor ) ;
1014
1015
strokeColor . push ( parameters . strokeOpacity ) ;
1015
1016
1017
+ let fontSize = isRank ? 2 * parameters . radius + "px" : parameters . fontSize ;
1018
+
1016
1019
return new ol . style . Style ( {
1017
1020
text : new ol . style . Text ( {
1018
1021
text : text ,
1019
- font : parameters . fontSize + " " + " supermapol-icons",
1022
+ font : fontSize + " supermapol-icons" ,
1020
1023
placement : 'point' ,
1021
1024
textAlign : 'center' ,
1022
1025
fill : new ol . style . Fill ( {
0 commit comments