以下是我的代码示例-
我尝试使用图片标记符号(如示例中所用)渲染地图,它工作得很好,但如果我使用 Graphic 对象内部文档中提到的 TextSymbol,应用程序将失败,并显示错误说 TypeError: Cannot read property 'setTransform ' 未定义且 u 未定义。有人可以帮我解决我做错的事情吗?
let mapProperties: any = {
basemap: "streets",
ground: "world-elevation"
};
let map: any = new Map(mapProperties);
let constructMap = function (lat, long, popupTemplate) {
var point = new Point({
longitude: lat,
latitude: long
});
var markerSymbol = new PictureMarkerSymbol({
url: "https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png",
width: "25px",
height: "41px"
});
var textSym = new TextSymbol({
text: "Sample Text"
});
console.log(textSym, markerSymbol);
var pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol,
popupTemplate: popupTemplate
});
var a = new MapView(mapViewProperties);
a.graphics.add(pointGraphic);