我遵循关于"https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli“的每一条指令,并试图使用下面的代码片段在地图上添加一个点。
const graphicsLayer = new GraphicsLayer();
sMap.add(graphicsLayer);
var point = {
type: "point",
longitude: -71.2643,
latitude: 42.0909
};
const simpleMarkerSymbol = {
type: "simple-marker",
color: [226, 119, 40],
outline: {
color: [255, 255, 255],
width: 1
}
};
const pointGraphic = new Graphic({
geometry:point,
symbol: simpleMarkerSymbol
});
graphicsLayer.add(pointGraphic);但我得到的类型是{ type: string;经度: number;纬度: number;}“与类型'GeometryProperties‘错误没有共同的属性。我也不知道原因。
发布于 2021-03-04 09:56:34
我没有使用var point={},而是使用var point=new点({});
密码就像,
import Point from '@arcgis/core/geometry/Point';
...
var point=new Point({
longitude:-117.173138,
latitude: 34.049599
});
...https://stackoverflow.com/questions/66463291
复制相似问题