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>

                            主站蜘蛛池模板: 冷凝水循环试验箱-冷凝水试验箱-可编程高低温试验箱厂家-上海巨为(www.juweigroup.com) | 安徽华耐泵阀有限公司-官方网站 安德建奇火花机-阿奇夏米尔慢走丝|高维|发那科-北京杰森柏汇 | 5nd音乐网|最新流行歌曲|MP3歌曲免费下载|好听的歌|音乐下载 免费听mp3音乐 | 圆形振动筛_圆筛_旋振筛_三次元振动筛-河南新乡德诚生产厂家 | 不锈钢水箱生产厂家_消防水箱生产厂家-河南联固供水设备有限公司 | 衡阳耐适防护科技有限公司——威仕盾焊接防护用品官网/焊工手套/焊接防护服/皮革防护手套 | 桁架机器人_桁架机械手_上下料机械手_数控车床机械手-苏州清智科技装备制造有限公司 | 水平垂直燃烧试验仪-灼热丝试验仪-漏电起痕试验仪-针焰试验仪-塑料材料燃烧检测设备-IP防水试验机 | 多功能真空滤油机_润滑油全自动滤油机_高效真空滤油机价格-重庆润华通驰 | 青岛成人高考_山东成考报名网 | 不锈钢水管-不锈钢燃气管-卫生级不锈钢管件-不锈钢食品级水管-广东双兴新材料集团有限公司 | 英国公司注册-新加坡公司注册-香港公司开户-离岸公司账户-杭州商标注册-杭州优创企业 | 网站制作优化_网站SEO推广解决方案-无锡首宸信息科技公司 | 盘装氧量分析仪-防爆壁挂氧化锆分析仪-安徽吉帆仪表有限公司 | 中天寰创-内蒙古钢结构厂家|门式刚架|钢结构桁架|钢结构框架|包头钢结构煤棚 | 橡胶弹簧|复合弹簧|橡胶球|振动筛配件-新乡市永鑫橡胶厂 | 袋式过滤器,自清洗过滤器,保安过滤器,篮式过滤器,气体过滤器,全自动过滤器,反冲洗过滤器,管道过滤器,无锡驰业环保科技有限公司 | 广州二手电缆线回收,旧电缆回收,广州铜线回收-广东益福电缆线回收公司 | 振动台-振动试验台-振动冲击台-广东剑乔试验设备有限公司 | 智成电子深圳tdk一级代理-提供TDK电容电感贴片蜂鸣器磁芯lambda电源代理经销,TDK代理商有哪些TDK一级代理商排名查询。-深圳tdk一级代理 | 山东艾德实业有限公司 | 环保袋,无纺布袋,无纺布打孔袋,保温袋,环保袋定制,环保袋厂家,环雅包装-十七年环保袋定制厂家 | 鄂泉泵业官网|(杭州、上海、全国畅销)大流量防汛排涝泵-LW立式排污泵 | 品牌策划-品牌设计-济南之式传媒广告有限公司官网-提供品牌整合丨影视创意丨公关活动丨数字营销丨自媒体运营丨数字营销 | 一礼通 (www.yilitong.com)-企业礼品解决方案一站式服务平台 | 石油/泥浆/不锈钢防腐/砂泵/抽砂泵/砂砾泵/吸砂泵/压滤机泵 - 专业石油环保专用泵厂家 | 杭州|上海贴标机-百科 | 餐饮加盟网_特色餐饮连锁加盟店-餐饮加盟官网| GEDORE扭力螺丝刀-GORDON防静电刷-CHEMTRONICS吸锡线-上海卓君电子有限公司 | 活动策划,舞台搭建,活动策划公司-首选美湖上海活动策划公司 | 无线讲解器-导游讲解器-自助讲解器-分区讲解系统 品牌生产厂家[鹰米讲解-合肥市徽马信息科技有限公司] | 尼龙PA610树脂,尼龙PA612树脂,尼龙PA1010树脂,透明尼龙-谷骐科技【官网】 | 新能源汽车电机定转子合装机 - 电机维修设备 - 睿望达 | 【MBA备考网】-2024年工商管理硕士MBA院校/报考条件/培训/考试科目/提前面试/考试/学费-MBA备考网 | 手板-手板模型-手板厂-手板加工-生产厂家,[东莞创域模型] | 大_小鼠elisa试剂盒-植物_人Elisa试剂盒-PCR荧光定量试剂盒-上海一研生物科技有限公司 | 膜结构停车棚-自行车棚-膜结构汽车棚加工安装厂家幸福膜结构 | 通信天线厂家_室分八木天线_对数周期天线_天线加工厂_林创天线源头厂家 | 广西绿桂涂料--承接隔热涂料、隔音涂料、真石漆、多彩仿石漆等涂料工程双包施工 | 安徽集装箱厂-合肥国彩钢结构板房工程有限公司| 膏方加工_丸剂贴牌_膏滋代加工_湖北康瑞生物科技有限公司 |