YY. Style. DEFAULTOPTIONS
样式基本配置参数,样式的配置参数的枚举
js
console.log(YY.Style.DEFAULTOPTIONS)
//result
{
"image": {
"markerWidth": 28,
"markerHeight": 32,
"markerDx": 0,
"markerDy": 0,
"markerOpacity": 1,
"markerFile": null
},
"text": {
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
},
"imageAndText": {
"markerWidth": 28,
"markerHeight": 32,
"markerDx": 0,
"markerDy": 0,
"markerOpacity": 1,
"markerFile": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": null,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
},
"graphical": {
"markerType": "ellipse",
"markerFill": "#3388FF",
"markerFillOpacity": 1,
"markerLineColor": "#0099FF",
"markerLineWidth": 3,
"markerLineOpacity": 1,
"markerLineDasharray": [],
"markerFillPatternFile": null,
"markerWidth": 10,
"markerHeight": 10,
"markerDx": 0,
"markerDy": 0
},
"graphicalAndText": {
"markerType": "ellipse",
"markerFill": "#3388FF",
"markerFillOpacity": 1,
"markerLineColor": "#0099FF",
"markerLineWidth": 3,
"markerLineOpacity": 1,
"markerLineDasharray": [],
"markerFillPatternFile": null,
"markerWidth": 10,
"markerHeight": 10,
"markerDx": 0,
"markerDy": 0,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": null,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
},
"line": {
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null
},
"lineAndText": {
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": null,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
},
"fill": {
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"polygonFill": "#66ADEB",
"polygonOpacity": 0.3,
"polygonPatternFile": null
},
"fillAndText": {
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"polygonFill": "#66ADEB",
"polygonOpacity": 0.3,
"polygonPatternFile": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": null,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}
}
properties
- image: //图片样式
- 'markerWidth' : 28,
- 'markerHeight' : 32,
- 'markerDx' : 0,
- 'markerDy' : 0,
- 'markerOpacity': 1,
- 'markerFile':null, // 必要字段
json
{
"markerWidth": 28,
"markerHeight": 32,
"markerDx": 0,
"markerDy": 0,
"markerOpacity": 1,
"markerFile": null
}
- text: //文字样式
- 'textFaceName' : 'sans-serif',
- 'textName' : 'Iverson', 必要字段
- 'textWeight' : 'normal',
- 'textStyle' : 'normal',
- 'textSize' : 18,
- 'textFont' : null,
- 'textFill' : '#34495e',
- 'textOpacity' : 1,
- 'textWrapWidth' : null,
- 'textLineSpacing' : 0,
- 'textDx' : 0,
- 'textDy' : 0,
- 'textHorizontalAlignment' : 'middle',
- 'textVerticalAlignment' : 'middle',
- 'textAlign' : 'center',
- 'textHaloFill' : null,
- 'textHaloRadius' : 0,
- 'textWrapCharacter' : null
json
{
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": 0,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}
- imageAndText: //图片和文字联合样式
- 'markerWidth' : 28,
- 'markerHeight' : 32,
- 'markerDx' : 0,
- 'markerDy' : 0,
- 'markerOpacity': 1,
- 'markerFile':null, // 必要字段
- 'textFaceName' : 'sans-serif',
- 'textName' : 'Iverson', //value from name in geometry's properties
- 'textWeight' : 'normal', //'bold', 'bolder'
- 'textStyle' : 'normal', //'italic', 'oblique'
- 'textSize' : 18,
- 'textFont' : null, //same as CanvasRenderingContext2D.font, override textName, textWeight and textStyle
- 'textFill' : '#34495e',
- 'textOpacity' : 1,
- 'textHaloFill' : null,
- 'textHaloRadius' : 0,
- 'textWrapWidth' : null,
- 'textWrapCharacter' : null,
- 'textLineSpacing' : 0,
- 'textDx' : 0,
- 'textDy' : 0,
- 'textHorizontalAlignment' : 'middle', //left ||middle ||right ||auto
- 'textVerticalAlignment' : 'middle', // top ||middle ||bottom ||auto
- 'textAlign' : 'center' , //left ||right ||center ||auto
json
{
"markerWidth": 28,
"markerHeight": 32,
"markerDx": 0,
"markerDy": 0,
"markerOpacity": 1,
"markerFile": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": 0,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}
- line: //线样式
- 'lineColor' : '#0099FF',
- 'lineWidth' : 3,
- 'lineDasharray' : [a, b], //虚线,a 长度 , b 间隔
json
{
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null
}
- lineAndText:
- 'lineColor' : '#0099FF',
- 'lineWidth' : 3,
- 'lineDasharray' : [a, b], //虚线,a 长度 , b 间隔
- 'textFaceName' : 'sans-serif',
- 'textName' : 'Iverson', //value from name in geometry's properties
- 'textWeight' : 'normal', //'bold', 'bolder'
- 'textStyle' : 'normal', //'italic', 'oblique'
- 'textSize' : 18,
- 'textFont' : null, //same as CanvasRenderingContext2D.font, override textName, textWeight and textStyle
- 'textFill' : '#34495e',
- 'textOpacity' : 1,
- 'textHaloFill' : null,
- 'textHaloRadius' : 0,
- 'textWrapWidth' : null,
- 'textWrapCharacter' : null,
- 'textLineSpacing' : 0,
- 'textDx' : 0,
- 'textDy' : 0,
- 'textHorizontalAlignment' : 'middle', //left ||middle ||right ||auto
- 'textVerticalAlignment' : 'middle', // top ||middle ||bottom ||auto
- 'textAlign' : 'center' , //left ||right ||center ||auto
json
{
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": 0,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}
- fill: //多边形样式
- 'lineColor' : '#0099FF',
- 'lineWidth' : 3,
- 'lineDasharray' : [a, b], //虚线,a 长度 , b 间隔
- 'polygonFill' : '#66ADEB',
- 'polygonOpacity' : 0.3,
- 'polygonPatternFile':null,
json
{
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"polygonFill": "#66ADEB",
"polygonOpacity": 0.3,
"polygonPatternFile": null
}
- fillAndText:
- 'lineColor' : '#0099FF',
- 'lineWidth' : 3,
- 'lineDasharray' : [a, b], //虚线,a 长度 , b 间隔
- 'polygonFill' : '#66ADEB',
- 'polygonOpacity' : 0.3,
- 'polygonPatternFile':null,
- 'textFaceName' : 'sans-serif',
- 'textName' : 'Iverson', //value from name in geometry's properties
- 'textWeight' : 'normal', //'bold', 'bolder'
- 'textStyle' : 'normal', //'italic', 'oblique'
- 'textSize' : 18,
- 'textFont' : null, //same as CanvasRenderingContext2D.font, override textName, textWeight and textStyle
- 'textFill' : '#34495e',
- 'textOpacity' : 1,
- 'textHaloFill' : null,
- 'textHaloRadius' : 0,
- 'textWrapWidth' : null,
- 'textWrapCharacter' : null,
- 'textLineSpacing' : 0,
- 'textDx' : 0,
- 'textDy' : 0,
- 'textHorizontalAlignment' : 'middle', //left ||middle ||right ||auto
- 'textVerticalAlignment' : 'middle', // top ||middle ||bottom ||auto
- 'textAlign' : 'center' , //left ||right ||center ||auto,
json
{
"lineColor": "#0099FF",
"lineWidth": 3,
"lineDasharray": null,
"polygonFill": "#66ADEB",
"polygonOpacity": 0.3,
"polygonPatternFile": null,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": 0,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}
- graphical://矢量图形样式
- 'markerType': 'ellipse',
- 'markerFill': '#3388FF',
- 'markerFillOpacity': 1,
- 'markerLineColor': '#34495e',
- 'markerLineWidth': 3,
- 'markerLineOpacity': 1,
- 'markerLineDasharray':[],
- 'markerWidth': 10,
- 'markerHeight': 10,
- 'markerDx': 0,
- 'markerDy': 0,
- 'markerFillPatternFile':null
json
{
"markerType": "ellipse",
"markerFill": "#3388FF",
"markerFillOpacity": 1,
"markerLineColor": "#0099FF",
"markerLineWidth": 3,
"markerLineOpacity": 1,
"markerLineDasharray": [],
"markerFillPatternFile": null,
"markerWidth": 10,
"markerHeight": 10,
"markerDx": 0,
"markerDy": 0
}
- graphicalAndText: 矢量图形和文本联合样式
- 'markerType': 'ellipse',
- 'markerFill': '#3388FF',
- 'markerFillOpacity': 1,
- 'markerLineColor': '#34495e',
- 'markerLineWidth': 3,
- 'markerLineOpacity': 1,
- 'markerLineDasharray':[],
- 'markerWidth': 10,
- 'markerHeight': 10,
- 'markerDx': 0,
- 'markerDy': 0,
- 'markerFillPatternFile':null,
- 'textFaceName' : 'sans-serif',
- 'textName' : 'Iverson', //value from name in geometry's properties
- 'textWeight' : 'normal', //'bold', 'bolder'
- 'textStyle' : 'normal', //'italic', 'oblique'
- 'textSize' : 18,
- 'textFont' : null, //same as CanvasRenderingContext2D.font, override textName, textWeight and textStyle
- 'textFill' : '#34495e',
- 'textOpacity' : 1,
- 'textHaloFill' : null,
- 'textHaloRadius' : 0,
- 'textWrapWidth' : null,
- 'textWrapCharacter' : null,
- 'textLineSpacing' : 0,
- 'textDx' : 0,
- 'textDy' : 0,
- 'textHorizontalAlignment' : 'middle', //left ||middle ||right ||auto
- 'textVerticalAlignment' : 'middle', // top ||middle ||bottom ||auto
- 'textAlign' : 'center' , //left ||right ||center ||auto,
json
{
"markerType": "ellipse",
"markerFill": "#3388FF",
"markerFillOpacity": 1,
"markerLineColor": "#0099FF",
"markerLineWidth": 3,
"markerLineOpacity": 1,
"markerLineDasharray": [],
"markerFillPatternFile": null,
"markerWidth": 10,
"markerHeight": 10,
"markerDx": 0,
"markerDy": 0,
"textFaceName": "sans-serif",
"textName": "Iverson",
"textWeight": "normal",
"textStyle": "normal",
"textSize": 18,
"textFont": null,
"textFill": "#34495e",
"textOpacity": 1,
"textHaloFill": null,
"textHaloRadius": 0,
"textWrapWidth": null,
"textWrapCharacter": null,
"textLineSpacing": 0,
"textDx": 0,
"textDy": 0,
"textHorizontalAlignment": "middle",
"textVerticalAlignment": "middle",
"textAlign": "center"
}