정점을 편집 할 때 정점 기호를 SimpleMarkerSymbol 및 TextSymbol로 바꾸고 싶습니다.하지만 이는 불가능한 것처럼 보입니다. 내가 어떻게이 일을 할 수 있겠 니?합성 기호를 만들 수 있습니까?
나는 그것이 불가능하다 결론에 도달 한 API 보는 시간을 복용 후 : I는 다음과 같이 드래그의 모양 (텍스트 + 원)합니다. 여기 내 해결 방법입니다 :
editor.on("vertex-move", args => {
let map = this.options.map;
let g = <Graphic>args.vertexinfo.graphic;
let startPoint = <Point>g.geometry;
let tx = args.transform;
let endPoint = map.toMap(map.toScreen(startPoint).offset(tx.dx, tx.dy));
// draw a 'cursor' as a hack to render text over the active vertex
if (!cursor) {
cursor = new Graphic(endPoint, new TextSymbol({text: "foo"}));
this.layer.add(cursor);
} else {
cursor.setGeometry(endPoint);
cursor.draw();
}
})
'vertex-move'핸들러에 연결하여 '커서'그래픽의 위치를 만들고 업데이트했습니다. 그것은 하나의 그래픽에 두 개의 심볼이 있다는 착각을 불러 일으 킵니다. –
여기에 코드를 추가하십시오 ... 지금까지 시도한 것은 무엇이든간에 ... –
저는 실제 코드를 추가했지만 원래는 vertextinfo.graphic을 숫자로 사용하여 원하는 효과를 얻었습니다.이 " 드래그 기능이 항상 위에 있기 때문에 "커서"그래픽이 배경이됩니다. –