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

<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="dl9jdj1" 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="dhrdzr1" 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>

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

                  問題描述

                  限時送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].

                  您只需要使用適當(dāng)?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="9tv97rj" 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'>

                            主站蜘蛛池模板: 培训中心-海南香蕉蛋糕加盟店技术翰香原中心官网总部 | 成人纸尿裤,成人尿不湿,成人护理垫-山东康舜日用品有限公司 | 精密五金加工厂-CNC数控车床加工_冲压件|蜗杆|螺杆加工「新锦泰」 | 视频教程导航网_视频教程之家_视频教程大全_最新视频教程分享发布平台 | 台湾HIWIN上银直线模组|导轨滑块|TBI滚珠丝杆丝杠-深圳汉工 | 哲力实业_专注汽车涂料汽车漆研发生产_汽车漆|修补油漆品牌厂家 长沙一级消防工程公司_智能化弱电_机电安装_亮化工程专业施工承包_湖南公共安全工程有限公司 | 我车网|我关心的汽车资讯_汽车图片_汽车生活! | 耙式干燥机_真空耙式干燥机厂家-无锡鹏茂化工装备有限公司 | 废水处理-废气处理-工业废水处理-工业废气处理工程-深圳丰绿环保废气处理公司 | 小型玉石雕刻机_家用玉雕机_小型万能雕刻机_凡刻雕刻机官网 | 臻知网大型互动问答社区-你的问题将在这里得到解答!-无锡据风网络科技有限公司 | 耐高温风管_耐高温软管_食品级软管_吸尘管_钢丝软管_卫生级软管_塑料波纹管-东莞市鑫翔宇软管有限公司 | 上海软件开发-上海软件公司-软件外包-企业软件定制开发公司-咏熠科技 | 烘干设备-热泵烘干机_广东雄贵能源设备有限公司 | 驾驶式洗地机/扫地机_全自动洗地机_工业洗地机_荣事达工厂官网 | 楼梯定制_楼梯设计施工厂家_楼梯扶手安装制作-北京凌步楼梯 | 测试治具|过炉治具|过锡炉治具|工装夹具|测试夹具|允睿自动化设备 | 翅片管换热器「型号全」_厂家-淄博鑫科环保 | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 共享雨伞_共享童车_共享轮椅_共享陪护床-共享产品的领先者_有伞科技 | 地图标注|微信高德百度地图标注|地图标记-做地图[ZuoMap.com] | 盐水蒸发器,水洗盐设备,冷凝结晶切片机,转鼓切片机,絮凝剂加药系统-无锡瑞司恩机械有限公司 | 食品级焦亚硫酸钠_工业级焦亚硫酸钠_焦亚硫酸钠-潍坊邦华化工有限公司 | 一体化污水处理设备-一体化净水设备-「山东梦之洁水处理」 | 餐饮加盟网_特色餐饮加盟店_餐饮连锁店加盟| 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 深圳市宏康仪器科技有限公司-模拟高空低压试验箱-高温防爆试验箱-温控短路试验箱【官网】 | 合肥钣金加工-安徽激光切割加工-机箱机柜加工厂家-合肥通快 | 沈阳液压泵_沈阳液压阀_沈阳液压站-沈阳海德太科液压设备有限公司 | 钢板仓,大型钢板仓,钢板库,大型钢板库,粉煤灰钢板仓,螺旋钢板仓,螺旋卷板仓,骨料钢板仓 | 精密五金加工厂-CNC数控车床加工_冲压件|蜗杆|螺杆加工「新锦泰」 | 铝板冲孔网,不锈钢冲孔网,圆孔冲孔网板,鳄鱼嘴-鱼眼防滑板,盾构走道板-江拓数控冲孔网厂-河北江拓丝网有限公司 | ?水马注水围挡_塑料注水围挡_防撞桶-常州瑞轩水马注水围挡有限公司 | 家乐事净水器官网-净水器厂家「官方」 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 光照全温振荡器(智能型)-恒隆仪器 | 动库网动库商城-体育用品专卖店:羽毛球,乒乓球拍,网球,户外装备,运动鞋,运动包,运动服饰专卖店-正品运动品网上商城动库商城网 - 动库商城 | 减速机电机一体机_带电机减速器一套_德国BOSERL电动机与减速箱生产厂家 | 上海噪音治理公司-专业隔音降噪公司-中广通环保 | 银川美容培训-美睫美甲培训-彩妆纹绣培训-新娘化妆-学化妆-宁夏倍莱妮职业技能培训学校有限公司 临时厕所租赁_玻璃钢厕所租赁_蹲式|坐式厕所出租-北京慧海通 | 电缆接头-防爆电缆接头-格兰头-金属电缆接头-防爆填料函 |