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

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

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

      1. 單擊(右鍵單擊)使用傳單地圖庫獲取圖像疊加層的

        Getting pixel coordinates of an image overlay using leaflet map library on click (right click)(單擊(右鍵單擊)使用傳單地圖庫獲取圖像疊加層的像素坐標)

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

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

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

              1. <tfoot id='sJUTa'></tfoot>
                • <bdo id='sJUTa'></bdo><ul id='sJUTa'></ul>
                    <tbody id='sJUTa'></tbody>

                • 本文介紹了單擊(右鍵單擊)使用傳單地圖庫獲取圖像疊加層的像素坐標的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用傳單地圖庫在單擊(右鍵單擊/上下文菜單)時獲取圖像疊加層的像素坐標.本質上,當用戶點擊圖片時,我需要找到用戶點擊圖片位置的 x、y 或寬度、高度.

                  I'm trying to get the pixel coordinates of an image overlay on click (right click/contextmenu) using the leaflet map library. Essentially when a user clicks on the image, I need to find the x,y or width,height of where the user clicked on the image.

                  目前這就是我所擁有的.

                  Currently this is what I have.

                  // Using leaflet.js to pan and zoom a big image.
                  // See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html
                  
                  // create the slippy map
                  var map = L.map('image-map', {
                      minZoom: 1,
                      maxZoom: 4,
                      center: [0, 0],
                      zoom: 1,
                      crs: L.CRS.Simple,
                  });
                  
                  // dimensions of the image
                  var w = 2000,
                      h = 1500,
                      url = 'http://kempe.net/images/newspaper-big.jpg';
                  
                  // calculate the edges of the image, in coordinate space
                  var southWest = map.unproject([0, h], map.getMaxZoom() - 1);
                  var northEast = map.unproject([w, 0], map.getMaxZoom() - 1);
                  var bounds = new L.LatLngBounds(southWest, northEast);
                  
                  // add the image overlay, 
                  // so that it covers the entire map
                  L.imageOverlay(url, bounds).addTo(map);
                  
                  // tell leaflet that the map is exactly as big as the image
                  map.setMaxBounds(bounds);
                  
                  function onMapClick(e) {
                  
                   //returns on right click events   
                   console.log(e);
                  
                  
                  }
                  
                  //Hadnel on right click functions TODO: MOVE THIS LATER
                  map.on('contextmenu', onMapClick);
                  

                  目前 onMapClick(e) 在檢查點擊返回的事件時,我看不到所有返回坐標的證據,任何靠近我點擊位置的 x、y 或寬度和高度.

                  Currently onMapClick(e) upon inspecting the returned events on click I see no evidence of all returned coordinates any where near to the x,y or width and height of the location I clicked.

                  鑒于圖像的尺寸為 20000x15000,基本上我想看到的是我單擊的圖像位置的 x、y 或寬度、高度.

                  Essentially what I would like to see is the x,y or width,height of the location of the image I clicked given that the image is 20000x15000 in dimension.

                  這里是小提琴 http://jsfiddle.net/rayshinn/yvfwzfw4/1/

                  不知道為什么,但是當您一直放大時,它似乎有點錯誤.只需一直放大它就可以阻止 jsfiddle 上的錯誤.這個錯誤不是重點,因為它不會發生在我的本地環境中!似乎和小提琴有關.

                  推薦答案

                  傳單為您提供沿image-map" div 的 x,y 坐標,該坐標會隨著放大和縮小而調整大小.事件坐標不會縮放到您的圖像大小.

                  The leaflet is giving you the x,y coordinates along the "image-map" div which resizes with the zoom in and out. The event coordinates do not scale to your image size.

                  為了獲得相對于實際圖片大小的 x,y,您需要將坐標乘以 當前 div 尺寸與全尺寸圖片的比率 尺寸.

                  In order to get x,y relative to actual picture size, you need to multiply the coordinates against the ratio of current div dimensions and full sized image dimensions.

                  我通過獲取事件坐標,將它們乘以您的 var wvar h 并除以地圖的高度和寬度來計算您的 x,y:

                  I calculated your x,y by taking the events coordinates, multiplying them by your var w and var h and dividing them by the maps height and width:

                  function onMapClick(e) {
                  
                      var mapWidth=map._container.offsetWidth;
                      var mapHeight=map._container.offsetHeight;
                      console.log(e.containerPoint.x * w / mapWidth);
                      console.log(e.containerPoint.y * h / mapHeight);
                      console.log(e);
                  
                  
                  }
                  

                  這篇關于單擊(右鍵單擊)使用傳單地圖庫獲取圖像疊加層的像素坐標的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中的默認加載磁貼顏色?)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標記的緯度和經度)
                  <legend id='0bgow'><style id='0bgow'><dir id='0bgow'><q id='0bgow'></q></dir></style></legend>
                    <bdo id='0bgow'></bdo><ul id='0bgow'></ul>
                    • <small id='0bgow'></small><noframes id='0bgow'>

                            <tbody id='0bgow'></tbody>

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

                            主站蜘蛛池模板: 91精品国模一区二区三区 | www国产成人免费观看视频,深夜成人网 | 久久国产精品免费视频 | 免费视频一区二区三区在线观看 | 一级片免费在线观看 | 成人不卡一区二区 | 国产综合精品一区二区三区 | 成人av一区二区三区 | 天天干夜夜操 | 中文字幕人成乱码在线观看 | 国产精品久久午夜夜伦鲁鲁 | 91精品国产一区二区三区 | 国产精品视频免费观看 | 成人精品一区二区三区 | 欧美性生活网 | 黄色大全免费看 | 99精品电影 | av在线一区二区 | 国产成人精品一区二区 | 午夜丁香视频在线观看 | 国产成视频在线观看 | 天天曰夜夜操 | 国产视频一区二区 | 成人在线电影在线观看 | 国产特级毛片aaaaaa喷潮 | 91亚洲国产亚洲国产 | 99精品国产一区二区三区 | 精品在线一区 | 福利国产 | 国产japanhdxxxx麻豆 | 久久国产高清视频 | 亚洲欧美在线一区 | 亚洲精品成人av久久 | 午夜影院免费体验区 | 国产亚洲高清视频 | 精品国产高清一区二区三区 | 精品免费 | 一级h片| 自拍第一页 | 日韩欧美国产成人一区二区 | 999久久久久久久久 国产欧美在线观看 |