思路:首先创建一个数字标记图层,然后在涂层上面添加数字标记
代码:
//数字标记数据源
this.vectorSourceNum = new VectorSource({
features: []
});
//数字标记图层
var vectorLayerNum = new VectorLayer({
source: this.vectorSourceNum
});
//将图层添加到地图
this.map.addLayer(vectorLayerNum);
//创建一个数字标记feature
var newFeature = new Feature(