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

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

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

      1. <legend id='xYA3Y'><style id='xYA3Y'><dir id='xYA3Y'><q id='xYA3Y'></q></dir></style></legend>
      2. Web 上的等距矩形地圖

        Equirectangular map on Web(Web 上的等距矩形地圖)
        1. <legend id='P0SAP'><style id='P0SAP'><dir id='P0SAP'><q id='P0SAP'></q></dir></style></legend>
              <i id='P0SAP'><tr id='P0SAP'><dt id='P0SAP'><q id='P0SAP'><span id='P0SAP'><b id='P0SAP'><form id='P0SAP'><ins id='P0SAP'></ins><ul id='P0SAP'></ul><sub id='P0SAP'></sub></form><legend id='P0SAP'></legend><bdo id='P0SAP'><pre id='P0SAP'><center id='P0SAP'></center></pre></bdo></b><th id='P0SAP'></th></span></q></dt></tr></i><div class="vn3tc8k" id='P0SAP'><tfoot id='P0SAP'></tfoot><dl id='P0SAP'><fieldset id='P0SAP'></fieldset></dl></div>

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

                  <tfoot id='P0SAP'></tfoot>

                • <small id='P0SAP'></small><noframes id='P0SAP'>

                    <tbody id='P0SAP'></tbody>

                • 本文介紹了Web 上的等距矩形地圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我計劃為游戲的標記(圖釘)構建在線地圖,但我無法設置標記的正確緯度.

                  I plan to build an online map for markers (pins) of a game and I don't manage to set the correct latitude of my markers.

                  原始地圖是一個2048*2048px的正方形

                  然后我得到了標記(數千個)

                  Then I got markers (many thousands)

                  地圖坐標使用從 0 到 100 的 x、y 表示法設置.0, 0 是地圖的左上角,100, 100 是地圖的右下角.x=50, y=50 就是 lat = 0°, lng = 0°(圖片的中心).

                  Map coordinates are set with a x, y notation from 0 to 100. 0, 0 is the top left corner and 100, 100 is the bottom right corner of the map. x=50, y=50 is lat = 0°, lng = 0° (the center of the picture).

                  為了從我的符號轉換為經度,我使用這個 JS 函數,它運行良好:

                  To convert from my notation to longitude I use this JS function, it works well :

                          function longitude(x)
                          {
                              var lng = 0
                              if (x < 50) // Negative Longitude (West)
                              {
                                  lng = (x - 50) / 50 * 180;
                              }
                              else // Positive Longitude (East)
                              {
                                  lng = (50 - x) / 50 * 180;
                              }
                              return lng
                          }
                  

                  但是對于緯度它不起作用,因為那些引擎使用墨卡托投影而我沒有.

                  But for latitude it don't work because those engines use a Mercator projection and me not.

                  如果有人有正確的公式,將不勝感激:(

                  If someone have the correct formula, it would be greatly appreciated :(

                  推薦答案

                  歡迎來到 SO!

                  如果您使用 Leaflet,則應指定地圖選項 crs 并使用 L.CRS.Simple:

                  If you are using Leaflet, you should specify the map option crs and use L.CRS.Simple:

                  一個簡單的 CRS,將經度和緯度直接映射到 xy.可用于平面地圖(例如游戲地圖).請注意,y 軸仍應反轉(從下到上).

                  A simple CRS that maps longitude and latitude into x and y directly. May be used for maps of flat surfaces (e.g. game maps). Note that the y axis should still be inverted (going from bottom to top).

                  這將避免 Web Mercator 投影,尤其是緯度,這是您的特殊計算想通了(有關方程式,請參閱鏈接的 Wikipedia 文章).

                  This will avoid the Web Mercator projection, especially the latitude which is a special computation as you figured out (see the linked Wikipedia article for the equation).

                  然后您就可以正確地將 xy 坐標映射到您的需要,尤其是在您的地圖圖像方面.

                  Then you are left with correctly mapping your x and y coordinates to your need, especially in respect with your map image.

                  例如,假設您將地圖圖像設置為:

                  For instance, assuming you set your map image as:

                  L.imageOverlay("imageUrl", [[0, 0], [256, 256]]).addTo(map);
                  

                  (使其在縮放級別 0 時適合 1 個圖塊)

                  (so that it fits the equivalent of 1 tile at zoom level 0)

                  然后您可以進行如下轉換:

                  Then you could have a conversion like:

                  function longitude(x) {
                    return x / 100 * 256;
                  }
                  
                  function latitude(y) {
                    return 256 - y / 100 * 256; // Still need to revert y.
                  }
                  

                  這篇關于Web 上的等距矩形地圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                  • <bdo id='DSFLW'></bdo><ul id='DSFLW'></ul>

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

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

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

                          1. <legend id='DSFLW'><style id='DSFLW'><dir id='DSFLW'><q id='DSFLW'></q></dir></style></legend>
                            主站蜘蛛池模板: 陕西视频监控,智能安防监控,安防系统-西安鑫安5A安防工程公司 | 抖音短视频运营_企业网站建设_网络推广_全网自媒体营销-东莞市凌天信息科技有限公司 | 蓄电池回收,ups电池后备电源回收,铅酸蓄电池回收,机房电源回收-广州益夫铅酸电池回收公司 | 好物生环保网、环保论坛 - 环保人的学习交流平台 | 欧景装饰设计工程有限公司-无锡欧景装饰官网 | 切铝机-数控切割机-型材切割机-铝型材切割机-【昆山邓氏精密机械有限公司】 | 游戏版号转让_游戏资质出售_游戏公司转让-【八九买卖网】 | 六自由度平台_六自由度运动平台_三自由度摇摆台—南京全控科技 | 卓能JOINTLEAN端子连接器厂家-专业提供PCB接线端子|轨道式端子|重载连接器|欧式连接器等电气连接产品和服务 | 99文库_实习生实用的范文资料文库站 | CTAB,表面活性剂1631溴型(十六烷基三甲基溴化铵)-上海升纬化工原料有限公司 | 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 冻干机(冷冻干燥机)_小型|实验型|食品真空冷冻干燥机-松源 | 实验室隔膜泵-无油防腐蚀隔膜泵-耐腐蚀隔膜真空泵-杭州景程仪器 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 分轨 | 上传文件,即刻分离人声和伴奏 | 聚合甘油__盐城市飞龙油脂有限公司 | 打包箱房_集成房屋-山东佳一集成房屋有限公司 | Eiafans.com_环评爱好者 环评网|环评论坛|环评报告公示网|竣工环保验收公示网|环保验收报告公示网|环保自主验收公示|环评公示网|环保公示网|注册环评工程师|环境影响评价|环评师|规划环评|环评报告|环评考试网|环评论坛 - Powered by Discuz! | 船用锚链|专业锚链生产厂家|安徽亚太锚链制造有限公司 | 房屋质量检测-厂房抗震鉴定-玻璃幕墙检测-房屋安全鉴定机构 | POS机办理_个人pos机免费领取-银联pos机申请首页 | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 合肥制氮机_合肥空压机厂家_安徽真空泵-凯圣精机 | 苗木价格-苗木批发-沭阳苗木基地-沭阳花木-长之鸿园林苗木场 | 中原网视台| 船用泵,船用离心泵,船用喷射泵,泰州隆华船舶设备有限公司 | 高压贴片电容|贴片安规电容|三端滤波器|风华电容代理南京南山 | 镀锌角钢_槽钢_扁钢_圆钢_方矩管厂家_镀锌花纹板-海邦钢铁(天津)有限公司 | elisa试剂盒-PCR试剂盒「上海谷研实业有限公司」| 新材料分散-高速均质搅拌机-超声波分散混合-上海化烁智能设备有限公司 | 红立方品牌应急包/急救包加盟,小成本好项目代理_应急/消防/户外用品加盟_应急好项目加盟_新奇特项目招商 - 中红方宁(北京) 供应链有限公司 | 济南ISO9000认证咨询代理公司,ISO9001认证,CMA实验室认证,ISO/TS16949认证,服务体系认证,资产管理体系认证,SC食品生产许可证- 济南创远企业管理咨询有限公司 郑州电线电缆厂家-防火|低压|低烟无卤电缆-河南明星电缆 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 爱德华真空泵油/罗茨泵维修,爱发科-比其尔产品供应东莞/杭州/上海等全国各地 | 消泡剂_水处理消泡剂_切削液消泡剂_涂料消泡剂_有机硅消泡剂_广州中万新材料生产厂家 | 广州云仓代发-昊哥云仓专业电商仓储托管外包代发货服务 | 带式过滤机厂家_价格_型号规格参数-江西核威环保科技有限公司 | 蒸汽吸附分析仪-进口水分活度仪|康宝百科 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 电梯装饰-北京万达中意电梯装饰有限公司 | 厂房出租_厂房出售_产业园区招商_工业地产&nbsp;-&nbsp;中工招商网 |