Open DuShuYuan opened 2 years ago
设置了对应属性 showCenterLabel: true, centerLabelPropertyName,没有效果 defaultStyle: { outlineColor: 'rgb(255,0,0)', lineWidth: 1, fill: false, tileCacheSize: 200, showMaker: true, showCenterLabel: true, pointSize: 15, ringRadius: 10, fontColor: 'rgba(255,0,0,1)', fontSize: 18, labelOffsetX: -10, labelOffsetY: -5, showLabel: true, showMarker: true, labelPropertyName: 'name', centerLabelPropertyName: 'name' },
showCenterLabel只对多边形有效。建议单独使用点数据集显示标注
比如加载以下json只有线,怎样显示“北京市”文字?properties.name 字段
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "adcode": 110000, "name": "北京市", "center": [ 116.405285, 39.904989 ], "centroid": [ 116.41995, 40.18994 ], "childrenNum": 16, "level": "province", "parent": { "adcode": 100000 }, "subFeatureIndex": 0, "acroutes": [ 100000 ] }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [