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

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

      • <bdo id='cMrQN'></bdo><ul id='cMrQN'></ul>
      <tfoot id='cMrQN'></tfoot>
      <legend id='cMrQN'><style id='cMrQN'><dir id='cMrQN'><q id='cMrQN'></q></dir></style></legend>
      1. <i id='cMrQN'><tr id='cMrQN'><dt id='cMrQN'><q id='cMrQN'><span id='cMrQN'><b id='cMrQN'><form id='cMrQN'><ins id='cMrQN'></ins><ul id='cMrQN'></ul><sub id='cMrQN'></sub></form><legend id='cMrQN'></legend><bdo id='cMrQN'><pre id='cMrQN'><center id='cMrQN'></center></pre></bdo></b><th id='cMrQN'></th></span></q></dt></tr></i><div class="nu8fl8k" id='cMrQN'><tfoot id='cMrQN'></tfoot><dl id='cMrQN'><fieldset id='cMrQN'></fieldset></dl></div>
      2. 傳單只加載一個瓷磚

        Leaflet only loads one tile(傳單只加載一個瓷磚)

          <tfoot id='NgyBO'></tfoot>
              <tbody id='NgyBO'></tbody>
          1. <small id='NgyBO'></small><noframes id='NgyBO'>

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

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

                  本文介紹了傳單只加載一個瓷磚的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我對 Leaflet 有一個問題,它實際上支撐了我的整個工作.由于某些我無法解釋的原因,Leaflet 的 UI 已正確加載到我的英特爾 XDK 應用程序中,但只加載了一個地圖圖塊 - 相同的代碼在另一個測試應用程序中工作!現在,我已經嘗試了我能做的一切,我希望這里有人能解決我的問題.

                  I have a problem with Leaflet that actually holds up my whole work. For some reasons I can not explain, the UI of Leaflet is correctly loaded in my Intel XDK app, but there is only one map tile loaded - the same code works in another test app! Now, that I tried everything I could do, I hope that someone here can solve my problem.

                  為了更好地理解,這里是我的leaflet.js 中的代碼(它不是leaflet.js,因為我使用leaflet-src.js 作為腳本)和屏幕截圖應用程序的地圖窗口.

                  For better understanding, here is the code in my leaflet.js (it isn't the leaflet.js, because I'm using the leaflet-src.js as script) and a screenshot of the map window of the app.

                  function initLeaflet() {
                  document.getElementById("map").setAttribute("style", "height:" + window.innerHeight + "px; width:" + window.innerWidth + "px;");
                  var map = L.map('map');
                  
                  L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
                      maxZoom: 18,
                      attribution: 'Map data &copy; <a >OpenStreetMap</a> contributors, ' +
                          '<a  +
                          'Imagery ? <a ,
                      id: 'examples.map-i875mjb7'
                  }).addTo(map);
                  
                  map.on('locationfound', onLocationFound);
                  map.on('locationerror', onLocationError);
                  
                  map.locate({setView: true, maxZoom: 16});
                  
                  map.on('click', onMapClick);
                  }
                  
                  function onLocationFound(e) {
                  var radius = e.accuracy / 2;
                  
                  L.marker(e.latlng).addTo(map)
                  .bindPopup("Position: " + e.latlng + " Genauigkeit " + radius ).openPopup();
                  
                  L.circle(e.latlng, radius).addTo(map);
                  }
                  
                  function onLocationError(e) {
                  alert(e.message);
                  }
                  
                  
                  function onMapClick(e) {
                  marker = new L.marker(e.latlng, {id:uni, icon:redIcon, draggable:'true'});
                  marker.on('dragend', function(event){
                      var marker = event.target;
                      var position = marker.getLatLng();
                      alert(position);
                      marker.setLatLng([position],{id:uni,draggable:'true'}).bindPopup(position).update();
                  });
                  map.addLayer(marker);
                  }     
                  
                  //var x = document.getElementById("demo");
                  
                  function getLocation() {
                  if (navigator.geolocation) {
                      navigator.geolocation.getCurrentPosition(showPosition);
                  } else { 
                      //x.innerHTML = "Geolocation is not supported by this browser.";
                  }
                  }
                  
                  function showPosition(position) {
                  //x.innerHTML = "Latitude: " + position.coords.latitude + 
                  //"<br>Longitude: " + position.coords.longitude;    
                  }
                  

                  http://imgur.com/exOUZuT

                  推薦答案

                  我猜是地圖初始化時的大小是罪魁禍首.

                  I would guess that the size of the map upon initialization is the culprit.

                  Leaflet 在初始化時需要知道它嵌入的元素的大小.Leaflet 使用該信息來了解要加載多少瓦片等.此外,對地圖大小的任何編程更改(或 Leaflet 無法輕易檢測到的更改)都必須遵循 map.invalidateSize(..) 鏈接.

                  Leaflet needs to know the size of the element it is embedded in when initializing. Leaflet uses that information to know how much tiles to load etc. Furthermore any programmatic changes (or changes that cannot be easily detected by Leaflet) to the size of the map have to be followed by map.invalidateSize(..) link.

                  我懷疑在您設置大小后,Leaflet 無法正確讀取 #map 元素的新大小.之后嘗試使大小無效或異步運行初始化.我要補充:

                  I suspect that after you set the size, Leaflet fails to read properly the new size of the #map element. Try invalidating the size afterwards or run initialization asynchronously. I would add:

                  setTimeout(function () {
                      map.invalidateSize();
                  }, 0);
                  

                  并檢查它是否變得更好.

                  and check if it gets any better.

                  這篇關于傳單只加載一個瓷磚的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                      <tbody id='h6CaI'></tbody>
                    <legend id='h6CaI'><style id='h6CaI'><dir id='h6CaI'><q id='h6CaI'></q></dir></style></legend>
                    • <bdo id='h6CaI'></bdo><ul id='h6CaI'></ul>

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

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

                          • <tfoot id='h6CaI'></tfoot>
                            主站蜘蛛池模板: 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | Magnescale探规,Magnescale磁栅尺,Magnescale传感器,Magnescale测厚仪,Mitutoyo光栅尺,笔式位移传感器-苏州连达精密量仪有限公司 | 岩棉板|岩棉复合板|聚氨酯夹芯板|岩棉夹芯板|彩钢夹芯板-江苏恒海钢结构 | 工业雾炮机_超细雾炮_远程抑尘射雾器-世纪润德环保设备 | 深圳办公室装修-写字楼装修设计-深圳标榜装饰公司 | 外贮压-柜式-悬挂式-七氟丙烷-灭火器-灭火系统-药剂-价格-厂家-IG541-混合气体-贮压-非贮压-超细干粉-自动-灭火装置-气体灭火设备-探火管灭火厂家-东莞汇建消防科技有限公司 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 | 深圳3D打印服务-3D打印加工-手板模型加工厂-悟空打印坊 | 直读光谱仪,光谱分析仪,手持式光谱仪,碳硫分析仪,创想仪器官网 | 辽宁资质代办_辽宁建筑资质办理_辽宁建筑资质延期升级_辽宁中杭资质代办 | 通辽信息港 - 免费发布房产、招聘、求职、二手、商铺等信息 www.tlxxg.net | vr安全体验馆|交通安全|工地安全|禁毒|消防|安全教育体验馆|安全体验教室-贝森德(深圳)科技 | 储能预警-储能消防系统-电池舱自动灭火装置-四川千页科技股份有限公司官网 | 硬度计_影像测量仪_维氏硬度计_佛山市精测计量仪器设备有限公司厂家 | 筛分机|振动筛分机|气流筛分机|筛分机厂家-新乡市大汉振动机械有限公司 | 盘装氧量分析仪-防爆壁挂氧化锆分析仪-安徽吉帆仪表有限公司 | 自进式锚杆-自钻式中空注浆锚杆-洛阳恒诺锚固锚杆生产厂家 | 屏蔽泵厂家,化工屏蔽泵_维修-淄博泵业 | 电线电缆厂家|沈阳电缆厂|电线厂|沈阳英联塑力线缆有限公司 | 广州二手电缆线回收,旧电缆回收,广州铜线回收-广东益福电缆线回收公司 | 光纤测温-荧光光纤测温系统-福州华光天锐光电科技有限公司 | 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | 工业铝型材-铝合金电机壳-铝排-气动执行器-山东永恒能源集团有限公司 | 河南道路标志牌_交通路标牌_交通标志牌厂家-郑州路畅交通 | 荣事达手推洗地机_洗地机厂家_驾驶式扫地机_工业清洁设备 | 胜为光纤光缆_光纤跳线_单模尾纤_光纤收发器_ODF光纤配线架厂家直销_北京睿创胜为科技有限公司 - 北京睿创胜为科技有限公司 | 石家庄小程序开发_小程序开发公司_APP开发_网站制作-石家庄乘航网络科技有限公司 | 存包柜厂家_电子存包柜_超市存包柜_超市电子存包柜_自动存包柜-洛阳中星 | 厌氧工作站-通用型厌氧工作站-上海胜秋科学仪器有限公司 | 一体化净水器_一体化净水设备_一体化水处理设备-江苏旭浩鑫环保科技有限公司 | 江苏南京多语种翻译-专业翻译公司报价-正规商务翻译机构-南京华彦翻译服务有限公司 | 单电机制砂机,BHS制砂机,制沙机设备,制砂机价格-正升制砂机厂家 单级/双级旋片式真空泵厂家,2xz旋片真空泵-浙江台州求精真空泵有限公司 | 翅片管散热器价格_钢制暖气片报价_钢制板式散热器厂家「河北冀春暖气片有限公司」 | 南京办公用品网-办公文具用品批发-打印机耗材采购 | 钢板仓,大型钢板仓,钢板库,大型钢板库,粉煤灰钢板仓,螺旋钢板仓,螺旋卷板仓,骨料钢板仓 | 打孔器,打孔钳厂家【温州新星德牌五金工具】 | 超细粉碎机|超微气流磨|气流分级机|粉体改性设备|超微粉碎设备-山东埃尔派粉碎机厂家 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 算命免费_生辰八字_免费在线算命 - 卜算子算命网| 上海橡胶接头_弹簧减震器_金属软接头厂家-上海淞江集团 | 船用烟火信号弹-CCS防汛救生圈-船用救生抛绳器(海威救生设备) |