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

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

  • <tfoot id='VfKIv'></tfoot>

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

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

        Leaflet LatLngBounds 與更簡單的 CRS &amp;投影

        Leaflet LatLngBounds with simpler CRS amp; projection(Leaflet LatLngBounds 與更簡單的 CRS amp;投影)

        <legend id='p9njm'><style id='p9njm'><dir id='p9njm'><q id='p9njm'></q></dir></style></legend><tfoot id='p9njm'></tfoot>
          <tbody id='p9njm'></tbody>

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

              <bdo id='p9njm'></bdo><ul id='p9njm'></ul>
              1. <i id='p9njm'><tr id='p9njm'><dt id='p9njm'><q id='p9njm'><span id='p9njm'><b id='p9njm'><form id='p9njm'><ins id='p9njm'></ins><ul id='p9njm'></ul><sub id='p9njm'></sub></form><legend id='p9njm'></legend><bdo id='p9njm'><pre id='p9njm'><center id='p9njm'></center></pre></bdo></b><th id='p9njm'></th></span></q></dt></tr></i><div class="jvfxdp5" id='p9njm'><tfoot id='p9njm'></tfoot><dl id='p9njm'><fieldset id='p9njm'></fieldset></dl></div>
                • 本文介紹了Leaflet LatLngBounds 與更簡單的 CRS &amp;投影的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我使用的是最新的穩定版本 Leaflet 0.7.7,并且我使用的是繼承自 L.CRS.Simple 的自定義 CRS.

                  I'm using Leaflet 0.7.7, latest stable release, and I'm using a custom CRS inherited from L.CRS.Simple.

                  CRS:

                  它與 Simple CRS 非常相似,但 c 設置為 1(在 Simple 中,c 設置為 -1).

                  It is very similar to Simple CRS but with c set to 1 (in Simple, c is set to -1).

                  L.CRS.XY = L.Util.extend({}, L.CRS.Simple, {
                      code: 'XY',
                      projection: L.Projection.LonLat,
                      transformation: new L.Transformation(1, 0, 1, 0)
                  });
                  

                  這個 CRS 的目標是擁有一個真正的 {x, y} 地圖系統,其中 y 在到達地圖底部時變得更高(如位圖).

                  The goal of this CRS is to have a real {x, y} map system where y becomes higher when reaching the bottom of the map (like a bitmap).

                  要測試的代碼:

                  var southWest = L.latLng(133, 0);
                  var northEast = L.latLng(0, 170);
                  var bounds = L.latLngBounds(southWest, northEast);
                  
                  document._map.setMaxBounds(bounds);
                  document._map.fitBounds(bounds);
                  document._markers[68].setLatLng(bounds.getNorthEast());
                  
                  console.info('southWest', southWest);
                  // L.LatLng {lat: 133, lng: 0}
                  
                  console.info('northEast', northEast);
                  // L.LatLng {lat: 0, lng: 170}
                  
                  console.info('bounds', bounds);
                  // L.LatLngBounds (
                      _northEast: L.LatLng {lat: 133, lng: 170 }
                      _southWest: L.LatLng {lat: 0, lng: 0 }
                  )
                  

                  實際上,由于我有一個自定義 CRS,我認為 這些行 是問題的根源,因為在平面 {x, y} 系統中最大值和最小值不正確(即使我更喜歡使用點",但我只能使用LatLng"對象:confused:).

                  Actually, as I have a custom CRS, I think these lines are the source of the problem because maximum and minimum values are not correct in a plane {x, y} system (even if I would prefer to use "Point" but I can only use "LatLng" objects :confused: ).

                  所以實際上,這個問題似乎很明顯來自我的代碼,但實際上我想為此找到一個不需要我切換到 L.CRS.Simple 的解決方案 其中 y 坐標在地圖頂部變得更高.

                  So actually, it seems it is obvious that this issue comes from my code, but actually I'd like to find a solution for this that wouldn't need me to switch to L.CRS.Simple in which y coordinates get higher on top of the map.

                  那么在這個簡單的自定義投影中使用邊界的解決方案是什么?

                  So what's the solution to use bounds with this simple custom projection?

                  推薦答案

                  聽起來 Leaflet 在內部假設 y 點在下降時增加(如圖像中),而緯度應該相反(即下降時減少),如 min、max、<= 和 >=比較是硬編碼的.

                  It sounds like Leaflet internally assumes that y points increase when going down (like in images), and it should be the opposite for latitude (i.e. decrease when going down), as the min, max, <= and >= comparisons are hard-coded.

                  因此,可能不可能組成一個 CRS,它會給你一個與 Y 點方向相同的緯度.除非您準備好修改 Leaflet 庫中比較緯度的每個函數……

                  So there is probably no possibility to make up a CRS that will give you a latitude in the same direction as the Y points. Except if you are ready to modify every function that compares latitudes within Leaflet library…

                  如果您每次必須提供坐標時都使用中間轉換函數,而當您必須讀取坐標時則相反,您仍然可以隨意操作"數字.

                  You may still be able to "manipulate" numbers like you wish, if you use an intermediate conversion function every time you have to provide coordinates, and the opposite when you have to read coordinates.

                  這也讓您有機會將緯度 (y) 和經度 (x) 的順序恢復為 [x, y].

                  That would also give you the opportunity to revert the latitude (y) and longitude (x) order to be [x, y].

                  例如:

                  function revertLat(x, y) {
                    return [-y, x];
                  }
                  

                  演示:http://jsfiddle.net/ve2huzxw/101/

                  原答案:

                  還有什么理由不直接自定義 L.LatLngBounds 以使其符合您的需要?

                  Any reason for not directly customizing L.LatLngBounds as well, so that it fits your need?

                  首先,如果您并不完全需要 southWest 和 northEast,而只需要 corners 作為邊界,則可以按原樣使用 L.LatLngBounds.例如,即使拐角不完全是西南和東北,所有 Leaflet 方法也會繼續工作:map.fitBoundsL.imageOverlay 等應該可以正常工作.

                  First of all, if you do not exactly need southWest and northEast, but just corners for your bounds, you can use L.LatLngBounds as is. For instance, all Leaflet methods would keep working even if the corners are not exactly southWest and northEast: map.fitBounds, L.imageOverlay etc. should work fine.

                  否則,您將不得不在 L.LatLngBounds 中自定義許多方法(擴展、填充、包含、相交)以恢復最小/最大和 <=/>= 比較.

                  Otherwise, you would have to customize many methods in L.LatLngBounds (extend, pad, contains, intersects) to revert the min / max and <= / >= comparisons.

                  這篇關于Leaflet LatLngBounds 與更簡單的 CRS &amp;投影的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)

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

                          • <tfoot id='cvLXO'></tfoot>
                              <tbody id='cvLXO'></tbody>
                            主站蜘蛛池模板: 防爆电机_ybx3系列电机_河南省南洋防爆电机有限公司 | 阳光模拟试验箱_高低温试验箱_高低温冲击试验箱_快速温变试验箱|东莞市赛思检测设备有限公司 | 3d可视化建模_三维展示_产品3d互动数字营销_三维动画制作_3D虚拟商城 【商迪3D】三维展示服务商 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 【电子厂招聘_普工招工网_工厂招聘信息平台】-工立方打工网 | 同步带轮_同步带_同步轮_iHF合发齿轮厂家-深圳市合发齿轮机械有限公司 | 韦伯电梯有限公司 | 珠海冷却塔降噪维修_冷却塔改造报价_凉水塔风机维修厂家- 广东康明节能空调有限公司 | 期货软件-专业期货分析软件下载-云智赢 | 欧版反击式破碎机-欧版反击破-矿山石料破碎生产线-青州奥凯诺机械 | 免费分销系统 — 分销商城系统_分销小程序开发 -【微商来】 | 气体热式流量计-定量控制流量计(空气流量计厂家)-湖北南控仪表科技有限公司 | 博医通医疗器械互联网供应链服务平台_博医通 | ◆大型吹塑加工|吹塑加工|吹塑代加工|吹塑加工厂|吹塑设备|滚塑加工|滚塑代加工-莱力奇塑业有限公司 | 德国BOSCH电磁阀-德国HERION电磁阀-JOUCOMATIC电磁阀|乾拓百科 | 紫外可见光分光度计-紫外分光度计-分光光度仪-屹谱仪器制造(上海)有限公司 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 莱州网络公司|莱州网站建设|莱州网站优化|莱州阿里巴巴-莱州唯佳网络科技有限公司 | 粉丝机械,粉丝烘干机,粉丝生产线-招远市远东粉丝机械有限公司 | 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 美缝剂_美缝剂厂家_美缝剂加盟-地老板高端瓷砖美缝剂 | 浙江富广阀门有限公司| 招商帮-一站式网络营销服务|搜索营销推广|信息流推广|短视视频营销推广|互联网整合营销|网络推广代运营|招商帮企业招商好帮手 | 口信网(kousing.com) - 行业资讯_行业展会_行业培训_行业资料 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 法兰连接型电磁流量计-蒸汽孔板节流装置流量计-北京凯安达仪器仪表有限公司 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 | 「钾冰晶石」氟铝酸钾_冰晶石_氟铝酸钠「价格用途」-亚铝氟化物厂家 | 翅片管换热器「型号全」_厂家-淄博鑫科环保 | 世界箱包品牌十大排名,女包小众轻奢品牌推荐200元左右,男包十大奢侈品牌排行榜双肩,学生拉杆箱什么品牌好质量好 - Gouwu3.com | 档案密集柜_手动密集柜_智能密集柜_内蒙古档案密集柜-盛隆柜业内蒙古密集柜直销中心 | 河南空气能热水器-洛阳空气能采暖-洛阳太阳能热水工程-洛阳润达高科空气能商行 | 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 双齿辊破碎机-大型狼牙破碎机视频-对辊破碎机价格/型号图片-金联机械设备生产厂家 | 防火窗_耐火窗_防火门厂家_防火卷帘门-重庆三乐门业有限公司 | 安平县鑫川金属丝网制品有限公司,防风抑尘网,单峰防风抑尘,不锈钢防风抑尘网,铝板防风抑尘网,镀铝锌防风抑尘网 | 大连海岛旅游网>>大连旅游,大连海岛游,旅游景点攻略,海岛旅游官网 | 轻型地埋电缆故障测试仪,频响法绕组变形测试仪,静荷式卧式拉力试验机-扬州苏电 | C形臂_动态平板DR_动态平板胃肠机生产厂家制造商-普爱医疗 | 集装箱展厅-住人集装箱住宿|建筑|房屋|集装箱售楼处-山东锐嘉科技工程有限公司 | 云南标线|昆明划线|道路标线|交通标线-就选云南云路施工公司-云南云路科技有限公司 |