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

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

      <i id='Op6T2'><tr id='Op6T2'><dt id='Op6T2'><q id='Op6T2'><span id='Op6T2'><b id='Op6T2'><form id='Op6T2'><ins id='Op6T2'></ins><ul id='Op6T2'></ul><sub id='Op6T2'></sub></form><legend id='Op6T2'></legend><bdo id='Op6T2'><pre id='Op6T2'><center id='Op6T2'></center></pre></bdo></b><th id='Op6T2'></th></span></q></dt></tr></i><div class="hlbpn5p" id='Op6T2'><tfoot id='Op6T2'></tfoot><dl id='Op6T2'><fieldset id='Op6T2'></fieldset></dl></div>
      <legend id='Op6T2'><style id='Op6T2'><dir id='Op6T2'><q id='Op6T2'></q></dir></style></legend><tfoot id='Op6T2'></tfoot>
    1. <small id='Op6T2'></small><noframes id='Op6T2'>

    2. 圍繞傳單地圖中的點旋轉多邊形

      rotate polygon around point in leaflet map(圍繞傳單地圖中的點旋轉多邊形)
      <i id='ymeGr'><tr id='ymeGr'><dt id='ymeGr'><q id='ymeGr'><span id='ymeGr'><b id='ymeGr'><form id='ymeGr'><ins id='ymeGr'></ins><ul id='ymeGr'></ul><sub id='ymeGr'></sub></form><legend id='ymeGr'></legend><bdo id='ymeGr'><pre id='ymeGr'><center id='ymeGr'></center></pre></bdo></b><th id='ymeGr'></th></span></q></dt></tr></i><div class="vfnxtr7" id='ymeGr'><tfoot id='ymeGr'></tfoot><dl id='ymeGr'><fieldset id='ymeGr'></fieldset></dl></div>
        <bdo id='ymeGr'></bdo><ul id='ymeGr'></ul>
        • <legend id='ymeGr'><style id='ymeGr'><dir id='ymeGr'><q id='ymeGr'></q></dir></style></legend>
        • <tfoot id='ymeGr'></tfoot>

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

                  <tbody id='ymeGr'></tbody>
              1. 本文介紹了圍繞傳單地圖中的點旋轉多邊形的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一個問題,在我的傳單地圖中,我從多邊形創建了一個三角形:

                I have an issue, in my leaflet map I've created a triangle from polygon:

                var polygon = L.polygon([ 
                    [parseFloat(decimal_lat),parseFloat(decimal_lon)], 
                    [parseFloat(decimal_lat) + 1, parseFloat(decimal_lon) - 1], 
                    [parseFloat(decimal_lat) + 1, parseFloat(decimal_lon) + 1] ],       
                    {
                            color:'green'
                    });
                polygon.addTo(map);
                

                我想圍繞 Point[decimal_lon, decimal_lat] 旋轉這個多邊形.但我無法解決它..
                我創建了 DEMO,我正在旋轉多項式,我想旋轉我的三角形(多邊形)向您展示我的問題.

                and I want to rotate this polygon around Point[decimal_lon, decimal_lat]. But I'm not able to solve it..
                I've created DEMO, where I'm rotating polynom the same I want to rotate my triangle (polygon) to show you my problem.

                推薦答案

                一種方法是通過矩陣旋轉.https://en.wikipedia.org/wiki/Rotation_matrix.您想將該點平移到中心,然后應用旋轉,然后將其平移回來.

                One way to do it is through matrix rotation. https://en.wikipedia.org/wiki/Rotation_matrix. You want to translate the point to the center then apply the rotation, then translate it back.

                這就是你的代碼結尾的樣子.

                This is what the end of your code would look like.

                  //changing polyline with slider but I want to change polygon there
                  range_yaw.onchange = function() {
                    var yawAngle = (parseFloat(range_yaw.value) / (819 / 360) + 90)
                    // line
                    var center = [decimal_lat, decimal_lon]
                    var end = [decimal_lat + 2, decimal_lon + 2]
                    var pointListRotated = rotatePoints(center, [center, end], yawAngle)
                    polyline.setLatLngs(pointListRotated);
                    // polygon
                    var polygonPoints = [
                      center,
                      [center[0] + 1, center[1] - 1],
                      [center[0] + 1, center[1] + 1]
                    ]
                    polygonRotated = rotatePoints(center, polygonPoints, yawAngle)
                    polygon.setLatLngs(polygonRotated)
                  };
                
                  //
                  // rotate a list of points in [lat, lng] format about the center.
                  //
                  function rotatePoints(center, points, yaw) {
                    var res = []
                    var angle = yaw * (Math.PI / 180)
                    for(var i=0; i<points.length; i++) {
                      var p = points[i]
                      // translate to center
                      var p2 = [ p[0]-center[0], p[1]-center[1] ]
                      // rotate using matrix rotation
                      var p3 = [ Math.cos(angle)*p2[0] - Math.sin(angle)*p2[1], Math.sin(angle)*p2[0] + Math.cos(angle)*p2[1]]
                      // translate back to center
                      var p4 = [ p3[0]+center[0], p3[1]+center[1]]
                      // done with that point
                      res.push(p4)
                    }
                    return res
                  }
                

                這是一個演示

                這篇關于圍繞傳單地圖中的點旋轉多邊形的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='texfH'><style id='texfH'><dir id='texfH'><q id='texfH'></q></dir></style></legend>
                  <bdo id='texfH'></bdo><ul id='texfH'></ul>
                    <tfoot id='texfH'></tfoot>
                  1. <small id='texfH'></small><noframes id='texfH'>

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

                          主站蜘蛛池模板: 工业铝型材-铝合金电机壳-铝排-气动执行器-山东永恒能源集团有限公司 | 万师讲师网-优质讲师培训师供应商,讲师认证,找讲师来万师 | 飞象网 - 通信人每天必上的网站 全球化工设备网—化工设备,化工机械,制药设备,环保设备的专业网络市场。 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 天津拓展_天津团建_天津趣味运动会_天津活动策划公司-天津华天拓展培训中心 | 抖音短视频运营_企业网站建设_网络推广_全网自媒体营销-东莞市凌天信息科技有限公司 | 东莞螺丝|东莞螺丝厂|东莞不锈钢螺丝|东莞组合螺丝|东莞精密螺丝厂家-东莞利浩五金专业紧固件厂家 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏 | 精密模具制造,注塑加工,吹塑和吹瓶加工,EPS泡沫包装生产 - 济南兴田塑胶有限公司 | 伺服电机维修、驱动器维修「安川|三菱|松下」伺服维修公司-深圳华创益 | 东亚液氮罐-液氮生物容器-乐山市东亚机电工贸有限公司 | 蚂蚁分类信息系统 - PHP同城分类信息系统 - MayiCMS | 南方珠江-南方一线电缆-南方珠江科技电缆-南方珠江科技有限公司 南汇8424西瓜_南汇玉菇甜瓜-南汇水蜜桃价格 | 风信子发稿-专注为企业提供全球新闻稿发布服务 | RFID电子标签厂家-上海尼太普电子有限公司 | 粘度计维修,在线粘度计,二手博勒飞粘度计维修|收购-天津市祥睿科技有限公司 | 对夹式止回阀厂家,温州对夹式止回阀制造商--永嘉县润丰阀门有限公司 | Maneurop/美优乐压缩机,活塞压缩机,型号规格,技术参数,尺寸图片,价格经销商 | OLChemim试剂-ABsciex耗材-广州市自力色谱科仪有限公司 | 苏州防水公司_厂房屋面外墙防水_地下室卫生间防水堵漏-苏州伊诺尔防水工程有限公司 | 合金耐磨锤头_破碎机锤头_郑州市德勤建材有限公司 | 河南正规膏药生产厂家-膏药贴牌-膏药代加工-修康药业集团官网 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | 山东限矩型液力偶合器_液力耦合器易熔塞厂家-淄博市汇川源机械厂 | Eiafans.com_环评爱好者 环评网|环评论坛|环评报告公示网|竣工环保验收公示网|环保验收报告公示网|环保自主验收公示|环评公示网|环保公示网|注册环评工程师|环境影响评价|环评师|规划环评|环评报告|环评考试网|环评论坛 - Powered by Discuz! | 东莞注册公司-代办营业执照-东莞公司注册代理记账-极刻财税 | 美国HASKEL增压泵-伊莱科elettrotec流量开关-上海方未机械设备有限公司 | 东莞喷砂机-喷砂机-喷砂机配件-喷砂器材-喷砂加工-东莞市协帆喷砂机械设备有限公司 | 蔬菜配送公司|蔬菜配送中心|食材配送|饭堂配送|食堂配送-首宏公司 | 耐腐蚀泵,耐腐蚀真空泵,玻璃钢真空泵-淄博华舜耐腐蚀真空泵有限公司 | 济南保安公司加盟挂靠-亮剑国际安保服务集团总部-山东保安公司|济南保安培训学校 | 我车网|我关心的汽车资讯_汽车图片_汽车生活! | 紫外荧光硫分析仪-硫含量分析仪-红外光度测定仪-泰州美旭仪器 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | 全自动包装机_灌装机生产厂家-迈驰包装设备有限公司 | 拖链电缆_柔性电缆_伺服电缆_坦克链电缆-深圳市顺电工业电缆有限公司 | 模具硅橡胶,人体硅胶,移印硅胶浆厂家-宏图硅胶科技 | 东莞工厂厂房装修_无尘车间施工_钢结构工程安装-广东集景建筑装饰设计工程有限公司 | 明渠式紫外线杀菌器-紫外线消毒器厂家-定州市优威环保 | 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 安驭邦官网-双向万能直角铣头,加工中心侧铣头,角度头[厂家直销] 闸阀_截止阀_止回阀「生产厂家」-上海卡比阀门有限公司 |