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

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

    <legend id='FJjrP'><style id='FJjrP'><dir id='FJjrP'><q id='FJjrP'></q></dir></style></legend>

      1. <tfoot id='FJjrP'></tfoot>

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

        圖片上的傳單自定義坐標

        Leaflet custom coordinates on image(圖片上的傳單自定義坐標)
      2. <i id='Kepwb'><tr id='Kepwb'><dt id='Kepwb'><q id='Kepwb'><span id='Kepwb'><b id='Kepwb'><form id='Kepwb'><ins id='Kepwb'></ins><ul id='Kepwb'></ul><sub id='Kepwb'></sub></form><legend id='Kepwb'></legend><bdo id='Kepwb'><pre id='Kepwb'><center id='Kepwb'></center></pre></bdo></b><th id='Kepwb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Kepwb'><tfoot id='Kepwb'></tfoot><dl id='Kepwb'><fieldset id='Kepwb'></fieldset></dl></div>

                <tbody id='Kepwb'></tbody>

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

              1. <tfoot id='Kepwb'></tfoot>
              2. <legend id='Kepwb'><style id='Kepwb'><dir id='Kepwb'><q id='Kepwb'></q></dir></style></legend>
                  <bdo id='Kepwb'></bdo><ul id='Kepwb'></ul>

                • 本文介紹了圖片上的傳單自定義坐標的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個尺寸為 8576x8576px 的圖像,我想讓坐標匹配 1:1.我還想要圖像中心的坐標 0,0(現(xiàn)在中心是 -128,128).我也想顯示坐標.我想為用戶插入坐標放置一個定位按鈕,然后在地圖上找到它們.像這樣:http://xero-hurtworld.com/map_steam.php(我使用相同的圖像但更大).我設(shè)置的 tile 大小為 268px.

                  I have an image which size is 8576x8576px, and I want to make the coordinates match 1:1. Also I want the coordinates 0,0 in the center of the image (now the center is -128,128). And I want to show the coordinates too. I want to put a locate button for the user insert coordinates and then find them on the map. Something like this: http://xero-hurtworld.com/map_steam.php (I am using the same image but bigger). The tile size I made its 268px.

                  到目前為止我的代碼:

                  https://jsfiddle.net/ze62dte0/

                  <!DOCTYPE html>
                  <html>
                    <head>
                      <title>Map</title>
                      <meta charset="utf-8"/>
                      <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
                      <link rel="stylesheet"  />
                      <!--[if lte IE 8]>
                      <link rel="stylesheet"  />
                      <![endif]-->
                      <script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js" charset="utf-8"></script>
                      <script>
                        function init() {
                          var mapMinZoom = 0;
                          var mapMaxZoom = 3;
                          var map = L.map('map', {
                            maxZoom: mapMaxZoom,
                            minZoom: mapMinZoom,
                            crs: L.CRS.Simple
                          }).setView([0, 0], mapMaxZoom);
                  
                  
                  
                      window.latLngToPixels = function(latlng){
                      return window.map.project([latlng.lat,latlng.lng], window.map.getMaxZoom());
                      };
                      window.pixelsToLatLng = function(x,y){
                      return window.map.unproject([x,y], window.map.getMaxZoom());
                      };
                  
                          var mapBounds = new L.LatLngBounds(
                              map.unproject([0, 8576], mapMaxZoom),
                              map.unproject([8576, 0], mapMaxZoom));
                  
                          map.fitBounds(mapBounds);
                          L.tileLayer('{z}/{x}/{y}.jpg', {
                            minZoom: mapMinZoom, maxZoom: mapMaxZoom,
                            bounds: mapBounds,
                            noWrap: true,
                            tms: false
                          }).addTo(map);
                  
                          L.marker([0, 0]).addTo(map).bindPopup("Zero");
                  
                          L.marker([-128, 128]).addTo(map).bindPopup("center");
                  
                          var popup = L.popup();
                  
                          <!-- Click pop-up>
                          var popup = L.popup();
                  
                          function onMapClick(e) {
                              popup
                              .setLatLng(e.latlng)
                              .setContent("You clicked in " + e.latlng.toString ())
                              .openOn(map);
                          }
                  
                          map.on('click', onMapClick);
                  
                        }
                      </script>
                      <style>
                        html, body, #map { width:100%; height:100%; margin:0; padding:0; }
                      </style>
                    </head>
                    <body onload="init()">
                      <div id="map"></div>
                    </body>
                  </html>
                  

                  推薦答案

                  如果我理解正確,你想要一個類似于 L.CRS.Simple 的 CRS,它放置 tile 0/0/0(tile大小為 268px,即 8576/2?),這樣:

                  If I understand correctly, you want a CRS similar to L.CRS.Simple that places tile 0/0/0 (tile size 268px, which is 8576 / 2?) so that:

                  • 位置 [0, 0] 位于該圖塊的中心.
                  • 整個世界(即整個 tile 0/0/0)從位置 [-8576/2, -8576/2][8576/2, 8576/2].
                  • Position [0, 0] is at the center of that tile.
                  • The entire world (i.e. entire tile 0/0/0) goes from position [-8576/2, -8576/2] to [8576/2, 8576/2].

                  您只需要使用適當?shù)霓D(zhuǎn)換來調(diào)整 L.CRS.Simple,以說明 1/2? = 1/32(而不僅僅是 1)的比例和 8576 的偏移量* 1/32/2 = 268/2 = 134(而不是 0.5).

                  You would just need to adjust the L.CRS.Simple with the appropriate transformation, to account for this scale of 1/2? = 1/32 (instead of just 1) and offset of 8576 * 1/32 / 2 = 268 / 2 = 134 (instead of 0.5).

                  L.CRS.MySimple = L.extend({}, L.CRS.Simple, {
                    transformation: new L.Transformation(1 / 32, 134, -1 / 32, 134)
                  });
                  
                  var map = L.map('map', {
                    maxZoom: mapMaxZoom,
                    minZoom: mapMinZoom,
                    crs: L.CRS.MySimple
                  }).setView([0, 0], mapMaxZoom);
                  

                  演示:http://plnkr.co/edit/5SQqp7SP4nf8muPM5iso?p=preview(我使用 Plunker 而不是 jsfiddle,因為您提供了帶有 HTML 的完整頁面代碼,而 jsfiddle 希望您將 HTML、CSS 和 JavaScript 代碼拆分為單獨的塊).

                  Demo: http://plnkr.co/edit/5SQqp7SP4nf8muPM5iso?p=preview (I used Plunker instead of jsfiddle because you provided a full page code with HTML, whereas jsfiddle expects you to split your HTML, CSS and JavaScript codes into separate blocks).

                  至于顯示坐標和定位"按鈕,它很容易實現(xiàn),因此與您提到的示例相似.如果您需要幫助,請隨時提出新問題.

                  As for showing the coordinates and a "locate" button, it would be quite easy to implement so that it is similar to the example you mention. Feel free to open new questions if you need help.

                  在上面的演示中,我使用 Leaflet.Coordinates 插件 來快速實現(xiàn)這兩個功能(參見地圖左下角的控件;您必須開始在地圖上移動鼠標才能顯示坐標;單擊該控件以打開編輯模式.

                  In the above demo, I used Leaflet.Coordinates plugin to implement quickly both functionalities (see the control on bottom left corner of the map; you have to start moving your mouse on the map for the coordinates to appear; click on that control to open the edition mode).

                  對于 Leaflet.Coordinates 插件,它將顯示的坐標經(jīng)度包裹起來以保持在 [-180;180] 度.

                  As for the Leaflet.Coordinates plugin, it wraps displayed coordinates longitude to stay within [-180; 180] degrees.

                  在坐標不是度數(shù)的情況下,包裹經(jīng)度沒有意義.

                  In your case where coordinates are not degrees, there is no point wrapping the longitude.

                  我認為這是造成點擊彈窗與控件坐標不一致的原因.

                  I think this is the cause for the discrepancy of coordinates between the click popup and the control.

                  只需修補插件代碼以防止包裝:

                  Simply patch the plugin code to prevent wrapping:

                  // Patch first to avoid longitude wrapping.
                  L.Control.Coordinates.include({
                    _update: function(evt) {
                      var pos = evt.latlng,
                        opts = this.options;
                      if (pos) {
                        //pos = pos.wrap(); // Remove that instruction.
                        this._currentPos = pos;
                        this._inputY.value = L.NumberFormatter.round(pos.lat, opts.decimals, opts.decimalSeperator);
                        this._inputX.value = L.NumberFormatter.round(pos.lng, opts.decimals, opts.decimalSeperator);
                        this._label.innerHTML = this._createCoordinateLabel(pos);
                      }
                    }
                  });
                  

                  更新的演示:http://plnkr.co/edit/M3Ru0xqn6AxAaSb4kIJU?p=preview

                  這篇關(guān)于圖片上的傳單自定義坐標的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                • <legend id='X31B0'><style id='X31B0'><dir id='X31B0'><q id='X31B0'></q></dir></style></legend>
                    <tbody id='X31B0'></tbody>

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

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

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

                            主站蜘蛛池模板: 羞羞网站在线免费观看 | 亚洲国产一区在线 | 国产精品久久久久久久久久免费看 | 午夜a级理论片915影院 | 欧美操操操 | 91精品免费 | 国产久 | 国产亚洲欧美在线视频 | 国产精品一区二区三区99 | 成人免费网站 | k8久久久一区二区三区 | 国产一级片免费视频 | 久久久久久91香蕉国产 | 黄色一级电影免费观看 | www.色53色.com | 久久69精品久久久久久久电影好 | 国产成人一区二区三区电影 | 青春草国产 | 国产精品久久久久久久久图文区 | a级免费黄色片 | 久久综合欧美 | 国产欧美日韩精品一区二区三区 | 国产精品久久国产精品 | 国产一区二区三区久久久久久久久 | av特级毛片| 亚洲a级| 久久国际精品 | 亚洲精品一区在线观看 | 国产九九精品 | 97久久精品 | 成人一区二区视频 | 亚洲大片在线观看 | 亚洲视频中文字幕 | 超黄毛片 | 日本亚洲欧美 | 在线视频一区二区 | 一级欧美一级日韩片免费观看 | 日日干干| 国产在线一区二区三区 | 91欧美精品成人综合在线观看 | 日本不卡免费新一二三区 |