pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    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="sjhrota" 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 從多邊形中獲取區域字符串

        How to get the area string from a polygon using leaflet.draw(如何使用 Leaflet.draw 從多邊形中獲取區域字符串)
        <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="wurze3b" 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 從多邊形中獲取區域字符串的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

                  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
                  }
                  

                  對此的任何幫助將不勝感激!

                  Any help on this would be appreciated!

                  推薦答案

                  您可以訪問 Leaflet 提供的幾何實用程序庫.

                  You can access the geometry utility library provided with Leaflet.

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

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

                  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);
                    }
                  }
                  

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

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

                  注意:面積默認為平方米

                  Note: area will be in squareMeters by default

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

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

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標記群集圖標顏色,繼承其余默認 CSS 屬性)
                  Trigger click on leaflet marker(觸發點擊傳單標記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  <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="zr8pjf3" 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>

                            主站蜘蛛池模板: 口臭的治疗方法,口臭怎么办,怎么除口臭,口臭的原因-口臭治疗网 | 烟气在线监测系统_烟气在线监测仪_扬尘检测仪_空气质量监测站「山东风途物联网」 | 佛山市德信昌电子有限公司 | 不锈钢水管-不锈钢燃气管-卫生级不锈钢管件-不锈钢食品级水管-广东双兴新材料集团有限公司 | 回收二手冲床_金丰旧冲床回收_协易冲床回收 - 大鑫机械设备 | 氟氨基酮、氯硝柳胺、2-氟苯甲酸、异香兰素-新晨化工 | 世界箱包品牌十大排名,女包小众轻奢品牌推荐200元左右,男包十大奢侈品牌排行榜双肩,学生拉杆箱什么品牌好质量好 - Gouwu3.com | 非小号行情 - 专业的区块链、数字藏品行情APP、金色财经官网 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 水平筛厂家-三轴椭圆水平振动筛-泥沙震动筛设备_山东奥凯诺矿机 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | HV全空气系统_杭州暖通公司—杭州斯培尔冷暖设备有限公司 | 包头市鑫枫装饰有限公司| 硫酸亚铁-聚合硫酸铁-除氟除磷剂-复合碳源-污水处理药剂厂家—长隆科技 | 二手Sciex液质联用仪-岛津气质联用仪-二手安捷伦气质联用仪-上海隐智科学仪器有限公司 | 蒸汽热收缩机_蒸汽发生器_塑封机_包膜机_封切收缩机_热收缩包装机_真空机_全自动打包机_捆扎机_封箱机-东莞市中堡智能科技有限公司 | 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 圆盘鞋底注塑机_连帮鞋底成型注塑机-温州天钢机械有限公司 | 硫化罐-胶管硫化罐-山东鑫泰鑫智能装备有限公司 | 美的商用净水器_美的直饮机_一级代理经销商_Midea租赁价格-厂家反渗透滤芯-直饮水批发品牌售后 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | 北京三友信电子科技有限公司-ETC高速自动栏杆机|ETC机柜|激光车辆轮廓测量仪|嵌入式车道控制器 | LED显示屏_LED屏方案设计精准报价专业安装丨四川诺显科技 | 数码听觉统合训练系统-儿童感觉-早期言语评估与训练系统-北京鑫泰盛世科技发展有限公司 | 博博会2021_中国博物馆及相关产品与技术博览会【博博会】 | 外贮压-柜式-悬挂式-七氟丙烷-灭火器-灭火系统-药剂-价格-厂家-IG541-混合气体-贮压-非贮压-超细干粉-自动-灭火装置-气体灭火设备-探火管灭火厂家-东莞汇建消防科技有限公司 | 中央空调温控器_风机盘管温控器_智能_液晶_三速开关面板-中央空调温控器厂家 | TTCMS自助建站_网站建设_自助建站_免费网站_免费建站_天天向上旗下品牌 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏 | 西安标准厂房_陕西工业厂房_西咸新区独栋厂房_长信科技产业园官方网站 | 无锡不干胶标签,卷筒标签,无锡瑞彩包装材料有限公司 | 河南卓美创业科技有限公司-河南卓美防雷公司-防雷接地-防雷工程-重庆避雷针-避雷器-防雷检测-避雷带-避雷针-避雷塔、机房防雷、古建筑防雷等-山西防雷公司 | 半自动预灌装机,卡式瓶灌装机,注射器灌装机,给药器灌装机,大输液灌装机,西林瓶灌装机-长沙一星制药机械有限公司 | 国际学校_国际学校哪个好_国际课程学校-国际学校择校网 | 滑石粉,滑石粉厂家,超细滑石粉-莱州圣凯滑石有限公司 | 带式过滤机厂家_价格_型号规格参数-江西核威环保科技有限公司 | 深圳网站建设-高端企业网站开发-定制网页设计制作公司 | 酒糟烘干机-豆渣烘干机-薯渣烘干机-糟渣烘干设备厂家-焦作市真节能环保设备科技有限公司 | 安徽华耐泵阀有限公司-官方网站 安德建奇火花机-阿奇夏米尔慢走丝|高维|发那科-北京杰森柏汇 | 真空粉体取样阀,电动楔式闸阀,电动针型阀-耐苛尔(上海)自动化仪表有限公司 | 真空干燥烘箱_鼓风干燥箱 _高低温恒温恒湿试验箱_光照二氧化碳恒温培养箱-上海航佩仪器 |