TextSymbol 在 MapView 中不起作用(ESRI 4.3 arcgis)
TextSymbol not working inside MapView(ESRI 4.3 arcgis)
以下是我的代码示例-
我尝试使用 Picture Marker Symbol(如示例中所用)渲染地图并且效果很好,但如果我使用 Graphic 对象中文档中提到的 TextSymbol,应用程序将失败并显示 TypeError 错误:无法读取未定义的 属性 '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);
验证定义中模块的顺序,它必须与函数参数的顺序完全匹配。
以下是我的代码示例-
我尝试使用 Picture Marker Symbol(如示例中所用)渲染地图并且效果很好,但如果我使用 Graphic 对象中文档中提到的 TextSymbol,应用程序将失败并显示 TypeError 错误:无法读取未定义的 属性 '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);
验证定义中模块的顺序,它必须与函数参数的顺序完全匹配。