arcgis for js缁樺埗闈?/a>

Posted 鍙嬩汉A

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了arcgis for js缁樺埗闈?/a>相关的知识,希望对你有一定的参考价值。

浣滆€呰繖閲岀敤鐨別sri鐗堟湰鏄?19
杩欓噷闇€瑕佹彁鍓嶅垵濮嬪寲draw鍖?strong>"esri/views/draw/Draw"

this.$message.success("寮€濮嬬粯鍒?);
var draw = new Draw({
view:this.view
})
var action = draw.create("polygon", {
  mode: "click"//鐐瑰嚮鏂瑰紡鍔犵偣
});
// 鑾峰彇鐒︾偣
this.view.focus();

// 椤剁偣娣诲姞浜嬩欢
action.on("vertex-add", (evt) =>{
this.createPolygon(evt)
});


//椤剁偣绉婚櫎浜嬩欢
action.on("vertex-remove", (evt) =>{
this.createPolygon(evt)

});
// 榧犳爣绉诲姩浜嬩欢
action.on("cursor-update", (evt) =>{
this.createPolygon(evt)
});


// 缁樺埗瀹屾垚浜嬩欢
action.on("draw-complete", (evt) =>{
this.createPolygon(evt)
this.$message.success("缁撴潫缁樺埗");

});

杩欓噷鐢ㄥ埌浜唃raphic鍜宲olygon涓や釜鍖?/p>

  1. "esri/Graphic"
  2. "esri/geometry/Polygon"
async createPolygon(event) {
    //鑾峰彇鎵€鏈夐《鐐?    var vertices = event.vertices;
    //娓呴櫎涔嬪墠缁樺埗
    this.view.graphics.removeAll();
    var Graphic = await arcgisPackage.Graphic;
    var Polygon = await arcgisPackage.Polygon;
    // 鐢熸垚缁樺埗鐨勫浘褰?    var graphic = new Graphic({
        geometry: new Polygon({
            hasZ: false,
            hasM: false,
            rings: [vertices],
            spatialReference: this.view.spatialReference
        }),
        symbol: {
            type: "simple-fill",  // autocasts as new SimpleFillSymbol()
            color: [ 51,51, 204, 0.9 ],
            style: "solid",
            outline: {  // autocasts as new SimpleLineSymbol()
                color: "white",
                width: 1
            }
        }
    });
    this.view.graphics.add(graphic);
    console.log(graphic.geometry.toJSON());
}

鏇村鏂囩珷馃憠鍘熶綔鑰呴摼鎺?/a>

以上是关于arcgis for js缁樺埗闈?/a>的主要内容,如果未能解决你的问题,请参考以下文章

Minecraft Client 鏁欑▼ #12 缁樺埗ClickGUI

Android涓娇鐢–anvas鍜孭aint缁樺埗涓€涓畨鍗撴満鍣ㄤ汉

璇﹁В CUDA By Example 涓殑 Julia Set 缁樺埗GPU浼樺寲

浣犺窛绂?WebGL 鍙樊涓€鐐癸紒

Mac 閰嶇疆 PlantUML