以classic为例
var geoText = new SuperMap.Geometry.GeoText(100, 35,"中华人民共和国"); var geotextFeature = new SuperMap.Feature.Vector(geoText); //新建一个策略并使用在矢量要素图层(vector)上。 var strategy = new SuperMap.Strategy.GeoText(); strategy.style = { fontColor:"#FF7F00", fontWeight:"bolder", fontSize:"14px", fill: true, fillColor: "#FFFFFF", fillOpacity: 1, stroke: true, strokeColor:"#8B7B8B" }; var vectorLayer = new SuperMap.Layer.Vector("Label",{strategies: [strategy]}); map.addLayers([vectorLayer]); vectorLayer.addFeatures([geotextFeature]);