久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <small id='ZOmCJ'></small><noframes id='ZOmCJ'>

    2. <legend id='ZOmCJ'><style id='ZOmCJ'><dir id='ZOmCJ'><q id='ZOmCJ'></q></dir></style></legend>
      <i id='ZOmCJ'><tr id='ZOmCJ'><dt id='ZOmCJ'><q id='ZOmCJ'><span id='ZOmCJ'><b id='ZOmCJ'><form id='ZOmCJ'><ins id='ZOmCJ'></ins><ul id='ZOmCJ'></ul><sub id='ZOmCJ'></sub></form><legend id='ZOmCJ'></legend><bdo id='ZOmCJ'><pre id='ZOmCJ'><center id='ZOmCJ'></center></pre></bdo></b><th id='ZOmCJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZOmCJ'><tfoot id='ZOmCJ'></tfoot><dl id='ZOmCJ'><fieldset id='ZOmCJ'></fieldset></dl></div>

    3. <tfoot id='ZOmCJ'></tfoot>

        <bdo id='ZOmCJ'></bdo><ul id='ZOmCJ'></ul>

        如何使用 Leaflet.draw 從多邊形中獲取區(qū)域字符串

        How to get the area string from a polygon using leaflet.draw(如何使用 Leaflet.draw 從多邊形中獲取區(qū)域字符串)
        <i id='cuBRJ'><tr id='cuBRJ'><dt id='cuBRJ'><q id='cuBRJ'><span id='cuBRJ'><b id='cuBRJ'><form id='cuBRJ'><ins id='cuBRJ'></ins><ul id='cuBRJ'></ul><sub id='cuBRJ'></sub></form><legend id='cuBRJ'></legend><bdo id='cuBRJ'><pre id='cuBRJ'><center id='cuBRJ'></center></pre></bdo></b><th id='cuBRJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cuBRJ'><tfoot id='cuBRJ'></tfoot><dl id='cuBRJ'><fieldset id='cuBRJ'></fieldset></dl></div>
        <legend id='cuBRJ'><style id='cuBRJ'><dir id='cuBRJ'><q id='cuBRJ'></q></dir></style></legend>
            <tbody id='cuBRJ'></tbody>
            <tfoot id='cuBRJ'></tfoot>

            <small id='cuBRJ'></small><noframes id='cuBRJ'>

              • <bdo id='cuBRJ'></bdo><ul id='cuBRJ'></ul>

                  本文介紹了如何使用 Leaflet.draw 從多邊形中獲取區(qū)域字符串的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試獲取多邊形的面積測(cè)量值,以便可以將它們列在地圖一側(cè)的表格中,靠近多邊形的名稱.這是我嘗試過但沒有成功的方法:

                  I am trying to get the area measurements of polygons so I can list them in a table to the side of the map, next to the name of the polygon. This is what I have tried with no success:

                  $("#polygon").on("click", function (){
                      createPolygon = new L.Draw.Polygon(map, drawControl.options.polygon);
                      createPolygon.enable();
                  }
                  
                  var polygon = new L.featureGroup();
                  
                  map.on('draw:created', function (e) {
                      var type = e.layerType,
                          layer = e.layer;
                      if (type === 'polygon') {
                        polygons.addLayer(layer);
                      }
                      var seeArea = createPolygon._getMeasurementString();
                     console.log(seeArea);  //Returns null
                  }
                  

                  對(duì)此的任何幫助將不勝感激!

                  Any help on this would be appreciated!

                  推薦答案

                  您可以訪問 Leaflet 提供的幾何實(shí)用程序庫(kù).

                  You can access the geometry utility library provided with Leaflet.

                  var area = L.GeometryUtil.geodesicArea(layer.getLatLngs());
                  

                  在您的示例中,您嘗試訪問控件本身,這是變量 createPolygon 分配給的內(nèi)容.相反,您想要獲取已繪制圖層的區(qū)域.

                  In your example, you are trying to access a control itself, which is what the variable createPolygon is assigned to. Instead, you want to take the area of the layer that got drawn.

                  map.on('draw:created', function (e) {
                    var type = e.layerType,
                        layer = e.layer;
                    if (type === 'polygon') {
                      polygons.addLayer(layer);
                      var seeArea = L.GeometryUtil.geodesicArea(layer.getLatLngs());
                      console.log(seeArea);
                    }
                  }
                  

                  確認(rèn)您獲得了該區(qū)域后,您只需將其分配給填充地圖旁邊表格的變量即可.

                  Once you verify you are getting the area, you can just assign it to the variables that populate the table next to the map.

                  注意:面積默認(rèn)為平方米

                  Note: area will be in squareMeters by default

                  這篇關(guān)于如何使用 Leaflet.draw 從多邊形中獲取區(qū)域字符串的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(nèi)部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                  Trigger click on leaflet marker(觸發(fā)點(diǎn)擊傳單標(biāo)記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側(cè)邊欄)
                  <legend id='arV6F'><style id='arV6F'><dir id='arV6F'><q id='arV6F'></q></dir></style></legend>
                  1. <i id='arV6F'><tr id='arV6F'><dt id='arV6F'><q id='arV6F'><span id='arV6F'><b id='arV6F'><form id='arV6F'><ins id='arV6F'></ins><ul id='arV6F'></ul><sub id='arV6F'></sub></form><legend id='arV6F'></legend><bdo id='arV6F'><pre id='arV6F'><center id='arV6F'></center></pre></bdo></b><th id='arV6F'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='arV6F'><tfoot id='arV6F'></tfoot><dl id='arV6F'><fieldset id='arV6F'></fieldset></dl></div>
                  2. <small id='arV6F'></small><noframes id='arV6F'>

                      <tbody id='arV6F'></tbody>
                      • <tfoot id='arV6F'></tfoot>

                        • <bdo id='arV6F'></bdo><ul id='arV6F'></ul>

                            主站蜘蛛池模板: 久久久久久av | 91综合在线视频 | 成人欧美一区二区三区在线播放 | 欧美日韩亚洲国产综合 | 日韩a | 亚洲精精品 | 成人国产精品久久久 | 免费一级淫片aaa片毛片a级 | 99久久99| 中文字幕一区在线观看视频 | 欧美福利 | 日本久久精品视频 | 亚洲乱码国产乱码精品精98午夜 | 国产乱精品一区二区三区 | 亚洲精品国产精品国自产在线 | 综合国产第二页 | 最新中文字幕在线 | 国产在线网址 | 美女天天操| 国产视频第一页 | 一区二区成人在线 | 国产欧美日韩综合精品一区二区 | 国产综合一区二区 | 国产精品久久久久久久久久免费看 | 成人在线免费观看 | 国产美女在线精品免费 | 欧美中文字幕在线观看 | 少妇诱惑av | 亚洲成年影院 | 免费国产视频在线观看 | 亚洲一区精品视频 | 国产成人精品久久二区二区91 | 欧美日韩国产一区二区 | 日韩快播电影 | 日本一区二区高清不卡 | 在线免费观看黄视频 | 亚洲欧美视频一区 | 精品国产精品一区二区夜夜嗨 | 日韩成人免费中文字幕 | 久久久久久亚洲精品不卡 | 欧美淫 |