久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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="qwawimqqmiuu" 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>
                            主站蜘蛛池模板: 日皮视频免费 | 日韩av一区二区在线 | 亚洲一二三区不卡 | 99久久99久久精品国产片果冰 | av在线天堂网 | 91av导航| 亚洲区一区二区 | 国产四虎| 一区在线观看 | 女女百合av大片一区二区三区九县 | 91久久久久 | 亚洲精品一区二区网址 | 欧美一级全黄 | 免费看片国产 | 欧美中文字幕一区二区三区 | 天天射色综合 | 欧美a区 | 午夜精品久久久久久久久久久久久 | 97人澡人人添人人爽欧美 | 国产精品污www一区二区三区 | 午夜精品一区二区三区在线播放 | 色av一区 | 日韩精品一区二区在线观看 | 黄色免费在线网址 | 欧美日韩电影在线 | 欧美福利一区 | 777zyz色资源站在线观看 | 久久久久国产精品一区三寸 | 久久久久亚洲精品国产 | 午夜影院在线观看 | 久久这里只有精品首页 | 亚洲日本欧美日韩高观看 | 一区二区在线 | 日韩欧美日韩在线 | 日韩成人精品一区二区三区 | 精品国产欧美一区二区三区成人 | aaa天堂 | 日韩一区二区在线看 | 日韩在线综合 | 青青草综合 | 成人精品久久久 |