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'>

                            主站蜘蛛池模板: 100国际学校招生 - 专业国际学校择校升学规划 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | 马尔表面粗糙度仪-MAHR-T500Hommel-Mitutoyo粗糙度仪-笃挚仪器 | 玉米深加工设备-玉米深加工机械-新型玉米工机械生产厂家-河南粮院机械制造有限公司 | pbootcms网站模板|织梦模板|网站源码|jquery建站特效-html5模板网 | 【北京写字楼出租_写字楼租赁_办公室出租网/出售】-远行地产官网 | 注塑模具_塑料模具_塑胶模具_范仕达【官网】_东莞模具设计与制造加工厂家 | 没斑啦-专业的祛斑美白嫩肤知识网站-去斑经验分享 | 全温恒温摇床-水浴气浴恒温摇床-光照恒温培养摇床-常州金坛精达仪器制造有限公司 | 屏蔽服(500kv-超高压-特高压-电磁)-徐吉电气 | 有机肥设备生产制造厂家,BB掺混肥搅拌机、复合肥设备生产线,有机肥料全部加工设备多少钱,对辊挤压造粒机,有机肥造粒设备 -- 郑州程翔重工机械有限公司 | 云南外加剂,云南速凝剂,云南外加剂代加工-普洱澜湄新材料科技有限公司 | 玻纤土工格栅_钢塑格栅_PP焊接_单双向塑料土工格栅_复合防裂布厂家_山东大庚工程材料科技有限公司 | 流程管理|流程管理软件|企业流程管理|微宏科技-AlphaFlow_流程管理系统软件服务商 | 捷码低代码平台 - 3D数字孪生_大数据可视化开发平台「免费体验」 | 机械加工_绞车配件_立式离心机_减速机-洛阳三永机械厂 | 水压力传感器_数字压力传感器|佛山一众传感仪器有限公司|首页 | 能耗监测系统-节能监测系统-能源管理系统-三水智能化 | 污水提升器,污水提升泵,地下室排水,增压泵,雨水泵,智能供排水控制器-上海智流泵业有限公司 | 油缸定制-液压油缸厂家-无锡大鸿液压气动成套有限公司 | EPK超声波测厚仪,德国EPK测厚仪维修-上海树信仪器仪表有限公司 | 双效节能浓缩器-热回流提取浓缩机组-温州市利宏机械 | 数码听觉统合训练系统-儿童感觉-早期言语评估与训练系统-北京鑫泰盛世科技发展有限公司 | 不锈钢拉手厂家|浴室门拉手厂家|江门市蓬江区金志翔五金制品有限公司 | 断桥铝破碎机_铝合金破碎机_废铁金属破碎机-河南鑫世昌机械制造有限公司 | 海水晶,海水素,海水晶价格-潍坊滨海经济开发区强隆海水晶厂 | ★店家乐|服装销售管理软件|服装店收银系统|内衣店鞋店进销存软件|连锁店管理软件|收银软件手机版|会员管理系统-手机版,云版,App | 中国品牌门窗网_中国十大门窗品牌_著名门窗品牌 | 美甲贴片-指甲贴片-穿戴美甲-假指甲厂家--薇丝黛拉 | 苏州西朗门业-欧盟CE|莱茵UL双认证的快速卷帘门品牌厂家 | 常州企业采购平台_常州MRO采购公司_常州米孚机电设备有限公司 | 高铝矾土熟料_细粉_骨料_消失模_铸造用铝矾土_铝酸钙粉—嵩峰厂家 | 泰安办公家具-泰安派格办公用品有限公司 | MTK核心板|MTK开发板|MTK模块|4G核心板|4G模块|5G核心板|5G模块|安卓核心板|安卓模块|高通核心板-深圳市新移科技有限公司 | 天津货架厂_穿梭车货架_重型仓储货架_阁楼货架定制-天津钢力仓储货架生产厂家_天津钢力智能仓储装备 | TYPE-C厂家|TYPE-C接口|TYPE-C防水母座|TYPE-C贴片-深圳步步精 | 磁力链接搜索神器_BT磁力狗_CILIMAO磁力猫_高效磁力搜索引擎2024 | 变色龙PPT-国内原创PPT模板交易平台 - PPT贰零 - 西安聚讯网络科技有限公司 | 合肥汽车充电桩_安徽充电桩_电动交流充电桩厂家_安徽科帝新能源科技有限公司 | 陶瓷砂磨机,盘式砂磨机,棒销式砂磨机-无锡市少宏粉体科技有限公司 |