以下是我的代码示例 -
我尝试使用图片标记符号(在示例中使用)渲染地图并且它工作得很好但是如果我使用Graphic对象内部文档中提到的TextSymbol,则应用程序失败并显示错误,说明TypeError:无法读取property' setTransform' undefined和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);
答案 0 :(得分:2)
验证定义中模块的顺序,它必须与函数参数的顺序完全匹配。