Echarts 新认知 地图的label到底怎么居中?

试过了offset和很多Api,都无法实现label居中

后来无意中发现,原来在geojson注册的时候,可以定义 properties.cp 属性,实现文本的坐标自定义,实现居中。

echarts.registerMap('china', {
    "type": "FeatureCollection",
    "features": [{
        "id": "650000",
        "type": "Feature",
        "geometry": {
            "type": "Polygon",
            "coordinates": [],
            "encodeOffsets": [[88824, 50096]]
        },
        "properties": {
            "cp": [87.617733, 43.792818],
            "name": "新疆",
            "childNum": 1
        }
    }],
    "UTF8Encoding": true
});
posted @ 2018-11-14 09:27  贝尔塔猫  阅读(2727)  评论(0编辑  收藏  举报