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

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

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

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

        <tfoot id='tt2kx'></tfoot>

        傳單正方形給定中心和正方形寬度

        leaflet square given centre and square width(傳單正方形給定中心和正方形寬度)
          <tbody id='B6Ysp'></tbody>

        <legend id='B6Ysp'><style id='B6Ysp'><dir id='B6Ysp'><q id='B6Ysp'></q></dir></style></legend>
        1. <tfoot id='B6Ysp'></tfoot>

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

                  <bdo id='B6Ysp'></bdo><ul id='B6Ysp'></ul>
                • <i id='B6Ysp'><tr id='B6Ysp'><dt id='B6Ysp'><q id='B6Ysp'><span id='B6Ysp'><b id='B6Ysp'><form id='B6Ysp'><ins id='B6Ysp'></ins><ul id='B6Ysp'></ul><sub id='B6Ysp'></sub></form><legend id='B6Ysp'></legend><bdo id='B6Ysp'><pre id='B6Ysp'><center id='B6Ysp'></center></pre></bdo></b><th id='B6Ysp'></th></span></q></dt></tr></i><div class="lxbjfl7" id='B6Ysp'><tfoot id='B6Ysp'></tfoot><dl id='B6Ysp'><fieldset id='B6Ysp'></fieldset></dl></div>

                  本文介紹了傳單正方形給定中心和正方形寬度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在 Leaflet 上,給定中心和半徑,我可以輕松創建一個新圓:

                  On Leaflet I can create a new circle easily given the centre and the radius:

                  // Circle
                  var radius = 500; // [metres]
                  var circleLocation = new L.LatLng(centreLat, centreLon);
                  var circleOptions = {
                      color: 'red',
                      fillColor: '#f03',
                      fillOpacity: 0.5
                  };
                  var circle = new L.Circle(circleLocation, radius, circleOptions);
                  map.addLayer(circle);
                  

                  上面的圓圈創建和繪制沒有問題,所以就是這樣.

                  The circle above is created and drawn without problems, so it is all.

                  但是,如果我現在想創建并繪制一個與圓為界的矩形,它就行不通了.這是我所做的:

                  However, if I wanted now to create and draw a rectangle that which bounds the circle, it does not work. Here is what I did:

                  // Rectangle
                  var halfside = radius;   // It was 500 metres as reported above
                  // convert from latlng to a point (<-- I think the problem is here!)
                  var centre_point = map.latLngToContainerPoint([newCentreLat, newCentreLon]);
                  // Compute SouthWest and NorthEast points
                  var sw_point = L.point([centre_point.x - halfside, centre_point.y - halfside]);
                  var ne_point = L.point([centre_point.x + halfside, centre_point.y + halfside]);
                  // Convert the obtained points to latlng
                  var sw_LatLng = map.containerPointToLatLng(sw_point);
                  var ne_LatLng = map.containerPointToLatLng(ne_point);
                  // Create bound
                  var bounds = [sw_LatLng, ne_LatLng];
                  var rectangleOptions = {
                      color: 'red',
                      fillColor: '#f03',
                      fillOpacity: 0.5
                  };
                  var rectangle = L.rectangle(bounds, rectangleOptions);
                  map.addLayer(rectangle);
                  

                  我得到的矩形的大小與500米無關.此外,看起來矩形的大小取決于地圖的縮放級別.圈子沒有出現這些問題.

                  The size of the rectangle that I obtain has nothing to do with 500 metres. Also, it looks like the size of the rectangle depends on the zoom level the map is. None of these problems arose for the circle.

                  我懷疑我將緯度/經度轉換為點的方式是錯誤的,反之亦然.

                  I suspect the way I transform the latitude/longitude to point and viceversa is wrong.

                  推薦答案

                  使用L.Circle繼承自L.PathgetBounds方法即可代碼>:

                  Just use the getBounds method that L.Circle inherits from L.Path:

                  返回路徑的 LatLngBounds.

                  Returns the LatLngBounds of the path.

                  http://leafletjs.com/reference.html#path-getbounds

                  var circle = new L.Circle([0,0], 500).addTo(map);
                  
                  var rectangle = new L.Rectangle(circle.getBounds()).addTo(map);
                  

                  Plunker 上的工作示例:http://plnkr.co/edit/n55xLOIohNMY6sVA3GLT?p=preview

                  Working example on Plunker: http://plnkr.co/edit/n55xLOIohNMY6sVA3GLT?p=preview

                  這篇關于傳單正方形給定中心和正方形寬度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='4Atoj'><style id='4Atoj'><dir id='4Atoj'><q id='4Atoj'></q></dir></style></legend>
                    <i id='4Atoj'><tr id='4Atoj'><dt id='4Atoj'><q id='4Atoj'><span id='4Atoj'><b id='4Atoj'><form id='4Atoj'><ins id='4Atoj'></ins><ul id='4Atoj'></ul><sub id='4Atoj'></sub></form><legend id='4Atoj'></legend><bdo id='4Atoj'><pre id='4Atoj'><center id='4Atoj'></center></pre></bdo></b><th id='4Atoj'></th></span></q></dt></tr></i><div class="b7d7nl7" id='4Atoj'><tfoot id='4Atoj'></tfoot><dl id='4Atoj'><fieldset id='4Atoj'></fieldset></dl></div>

                      <bdo id='4Atoj'></bdo><ul id='4Atoj'></ul>
                      <tfoot id='4Atoj'></tfoot>
                          <tbody id='4Atoj'></tbody>

                        <small id='4Atoj'></small><noframes id='4Atoj'>

                            主站蜘蛛池模板: 宁夏活性炭_防护活性炭_催化剂载体炭-宁夏恒辉活性炭有限公司 | 生鲜配送系统-蔬菜食材配送管理系统-连锁餐饮订货配送软件-挪挪生鲜供应链管理软件 | 卸料器-卸灰阀-卸料阀-瑞安市天蓝环保设备有限公司 | 除尘器布袋骨架,除尘器滤袋,除尘器骨架,电磁脉冲阀膜片,卸灰阀,螺旋输送机-泊头市天润环保机械设备有限公司 | 玖容气动液压设备有限公司-气液增压缸_压力机_增压机_铆接机_增压器 | 桥架-槽式电缆桥架-镀锌桥架-托盘式桥架 - 上海亮族电缆桥架制造有限公司 | 中高频感应加热设备|高频淬火设备|超音频感应加热电源|不锈钢管光亮退火机|真空管烤消设备 - 郑州蓝硕工业炉设备有限公司 | 动环监控_机房环境监控_DCIM_机房漏水检测-斯特纽 | 国际高中-国际学校-一站式择校服务-远播国际教育 | 全自动变压器变比组别测试仪-手持式直流电阻测试仪-上海来扬电气 | 橡胶接头|可曲挠橡胶接头|橡胶软接头安装使用教程-上海松夏官方网站 | 华禹护栏|锌钢护栏_阳台护栏_护栏厂家-华禹专注阳台护栏、楼梯栏杆、百叶窗、空调架、基坑护栏、道路护栏等锌钢护栏产品的生产销售。 | 常州翔天实验仪器厂-恒温振荡器-台式恒温振荡器-微量血液离心机 恒温恒湿箱(药品/保健品/食品/半导体/细菌)-兰贝石(北京)科技有限公司 | 权威废金属|废塑料|废纸|废铜|废钢价格|再生资源回收行情报价中心-中废网 | CTAB,表面活性剂1631溴型(十六烷基三甲基溴化铵)-上海升纬化工原料有限公司 | 精雕机-火花机-精雕机 cnc-高速精雕机-电火花机-广东鼎拓机械科技有限公司 | 二手色谱仪器,十万分之一分析天平,蒸发光检测器,电位滴定仪-湖北捷岛科学仪器有限公司 | 提升海外网站流量,增加国外网站访客UV,定制海外IP-访客王 | 北京翻译公司_同传翻译_字幕翻译_合同翻译_英语陪同翻译_影视翻译_翻译盖章-译铭信息 | PVC地板|PVC塑胶地板|PVC地板厂家|地板胶|防静电地板-无锡腾方装饰材料有限公司-咨询热线:4008-798-128 | 多功能三相相位伏安表-变压器短路阻抗测试仪-上海妙定电气 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏 | 三氯异氰尿酸-二氯-三氯-二氯异氰尿酸钠-优氯净-强氯精-消毒片-济南中北_优氯净厂家 | 深圳激光打标机_激光打标机_激光焊接机_激光切割机_同体激光打标机-深圳市创想激光科技有限公司 深圳快餐店设计-餐饮设计公司-餐饮空间品牌全案设计-深圳市勤蜂装饰工程 | 专业深孔加工_东莞深孔钻加工_东莞深孔钻_东莞深孔加工_模具深孔钻加工厂-东莞市超耀实业有限公司 | 焊接烟尘净化器__焊烟除尘设备_打磨工作台_喷漆废气治理设备 -催化燃烧设备 _天津路博蓝天环保科技有限公司 | Trimos测长机_测高仪_TESA_mahr,WYLER水平仪,PWB对刀仪-德瑞华测量技术(苏州)有限公司 | 新车测评网_网罗汽车评测资讯_汽车评测门户报道 | 干粉砂浆设备_干混砂浆生产线_腻子粉加工设备_石膏抹灰砂浆生产成套设备厂家_干粉混合设备_砂子烘干机--郑州铭将机械设备有限公司 | 大倾角皮带机-皮带输送机-螺旋输送机-矿用皮带输送机价格厂家-河南坤威机械 | 深圳侦探联系方式_深圳小三调查取证公司_深圳小三分离机构 | 盘煤仪,盘料仪,盘点仪,堆料测量仪,便携式激光盘煤仪-中科航宇(北京)自动化工程技术有限公司 | 手持式浮游菌采样器-全排二级生物安全柜-浙江孚夏医疗科技有限公司 | 龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司_龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司 | 导电银胶_LED封装导电银胶_半导体封装导电胶厂家-上海腾烁 | 政府园区专业委托招商平台_助力企业选址项目快速落地_东方龙商务集团 | 乐泰胶水_loctite_乐泰胶_汉高乐泰授权(中国)总代理-鑫华良供应链 | 不锈钢丸厂家,铝丸,铸钢丸-淄博智源铸造材料有限公司 | 【直乐】河北石家庄脊柱侧弯医院_治疗椎间盘突出哪家医院好_骨科脊柱外科专业医院_治疗抽动症/关节病骨伤权威医院|排行-直乐矫形中医医院 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 昆明网络公司|云南网络公司|昆明网站建设公司|昆明网页设计|云南网站制作|新媒体运营公司|APP开发|小程序研发|尽在昆明奥远科技有限公司 |