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

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

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

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

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

      2. 提供地圖瓦片包以供離線使用

        Offer packages of map tiles for offline use(提供地圖瓦片包以供離線使用)
          <tbody id='1n1us'></tbody>
        • <small id='1n1us'></small><noframes id='1n1us'>

          • <bdo id='1n1us'></bdo><ul id='1n1us'></ul>

            <legend id='1n1us'><style id='1n1us'><dir id='1n1us'><q id='1n1us'></q></dir></style></legend>

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

                  本文介紹了提供地圖瓦片包以供離線使用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在制作一個必須離線工作的網絡應用程序.到目前為止一切正常,我的最后一步是將地圖圖塊離線.幸運的是,我確切地知道用戶需要訪問地圖的哪些區域,因此我不必允許緩存數百萬個圖塊.

                  I'm making a web application that has to work offline. So far everything works and my last step is to take the map tiles offline. Luckily I know exactly what areas of the map will need to be accessible to users, so I don't have to allow caching of millions of tiles.

                  地圖分為多個區域,因此我們的想法是將這些區域的圖塊作為可下載的包"提供.

                  The map is split into areas and so the idea is to offer the tiles for these areas as downloadable 'packages.'

                  例如,當我在線時,我會轉到平鋪包"頁面,該頁面提供多個區域的下載.我選擇我感興趣的區域,它會下載瓷磚,當我離線時,我可以使用這些瓷磚.我只需要大約 2 個縮放級別,一個用于快速導航,一個用于快速導航,另一個用于獲取更多細節.

                  For instance, when I'm online, I go to the 'tile packages' page, which offers downloads for several areas. I choose the area which I'm interested in, it downloads the tiles, and when I go offline, I'm able to use these tiles. I only need about 2 zoom levels, one far out for quick navigation, and one more up close for more detail.

                  我正在使用傳單來提供地圖.有沒有人必須做這樣的事情并且可以給我一些指導?我真的不知道如何解決這個問題,這是最后一塊拼圖.

                  I'm using leaflet to serve up the map. Has anyone had to do something like this and could give me some guidance? I really just don't know how to even approach this, and it's the last piece of the puzzle.

                  推薦答案

                  這就是我想出的.我將地圖的一個區域導入我的數據庫.然后,我將此部分作為可下載的包提供.當用戶下載包時,將查詢數據庫并以 JSON 格式返回與該區域關聯的所有圖塊.圖像存儲為 blob.然后,我將這個圖塊數組傳遞給解析數據的自定義傳單層.這是圖層的代碼:

                  So here's what I came up with. I import an area of the map to my database. I then offer this section as a downloadable package. When the user downloads the package, the database is queried and returns all tiles associated with that area in JSON format. The images are stored as blobs. I then pass this array of tiles to a custom leaflet layer which parses the data. Here's the code for the layer:

                  define([], function() {
                      L.TileLayer.IDBTiles = L.TileLayer.extend({
                          initialize: function(url, options, tiles) {
                              options = L.setOptions(this, options);
                  
                              // detecting retina displays, adjusting tileSize and zoom levels
                              if (options.detectRetina && L.Browser.retina && options.maxZoom > 0) {
                  
                                  options.tileSize = Math.floor(options.tileSize / 2);
                                  options.zoomOffset++;
                  
                                  if (options.minZoom > 0) {
                                      options.minZoom--;
                                  }
                                  this.options.maxZoom--;
                              }
                  
                              this._url = url;
                  
                              var subdomains = this.options.subdomains;
                  
                              if (typeof subdomains === 'string') {
                                  this.options.subdomains = subdomains.split('');
                              }
                  
                              this.tiles = tiles;
                          },
                          getTileUrl: function (tilePoint) {
                              this._adjustTilePoint(tilePoint);
                  
                              var z = this._getZoomForUrl();
                              var x = tilePoint.x;
                              var y = tilePoint.y;
                  
                              var result = this.tiles.filter(function(row) {
                                  return (row.value.tile_column === x
                                          && row.value.tile_row === y
                                          && row.value.zoom_level === z);
                              });
                  
                              if(result[0]) return result[0].value.tile_data;
                              else return;
                          }
                      });
                  });
                  

                  這篇關于提供地圖瓦片包以供離線使用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='iouf1'></tbody>
                      <bdo id='iouf1'></bdo><ul id='iouf1'></ul>

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

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

                          • <tfoot id='iouf1'></tfoot>

                          • 主站蜘蛛池模板: 氧化锆纤维_1800度高温退火炉_1800度高温烧结炉-南京理工宇龙新材料股份有限公司 | IHDW_TOSOKU_NEMICON_EHDW系列电子手轮,HC1系列电子手轮-上海莆林电子设备有限公司 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 成都APP开发-成都App定制-成都app开发公司-【未来久】 | 篮球架_乒乓球台_足球门_校园_竞技体育器材_厂家_价格-沧州浩然体育器材有限公司 | 断桥铝破碎机_铝合金破碎机_废铁金属破碎机-河南鑫世昌机械制造有限公司 | 智慧物联网行业一站式解决方案提供商-北京东成基业 | 通风气楼_通风天窗_屋顶风机-山东美创通风设备有限公司 | TYPE-C厂家|TYPE-C接口|TYPE-C防水母座|TYPE-C贴片-深圳步步精 | 上海小程序开发-小程序制作-上海小程序定制开发公司-微信商城小程序-上海咏熠 | OLChemim试剂-ABsciex耗材-广州市自力色谱科仪有限公司 | 带式压滤机_污泥压滤机_污泥脱水机_带式过滤机_带式压滤机厂家-河南恒磊环保设备有限公司 | 学叉车培训|叉车证报名|叉车查询|叉车证怎么考-工程机械培训网 | 禹城彩钢厂_钢结构板房_彩钢复合板-禹城泰瑞彩钢复合板加工厂 | 安徽合肥项目申报咨询公司_安徽合肥高新企业项目申报_安徽省科技项目申报代理 | 环讯传媒,永康网络公司,永康网站建设,永康小程序开发制作,永康网站制作,武义网页设计,金华地区网站SEO优化推广 - 永康市环讯电子商务有限公司 | 食品无尘净化车间,食品罐装净化车间,净化车间配套风淋室-青岛旭恒洁净技术有限公司 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 楼承板设备-楼承板成型机-免浇筑楼承板机器厂家-捡来 | 科研ELISA试剂盒,酶联免疫检测试剂盒,昆虫_植物ELISA酶免试剂盒-上海仁捷生物科技有限公司 | 品牌策划-品牌设计-济南之式传媒广告有限公司官网-提供品牌整合丨影视创意丨公关活动丨数字营销丨自媒体运营丨数字营销 | 板式换热器_板式换热器价格_管式换热器厂家-青岛康景辉 | 至顶网| 双段式高压鼓风机-雕刻机用真空泵-绍兴天晨机械有限公司 | 影合社-影视人的内容合作平台 | 天津试验仪器-电液伺服万能材料试验机,恒温恒湿标准养护箱,水泥恒应力压力试验机-天津鑫高伟业科技有限公司 | 焊管生产线_焊管机组_轧辊模具_焊管设备_焊管设备厂家_石家庄翔昱机械 | 皮带式输送机械|链板式输送机|不锈钢输送机|网带输送机械设备——青岛鸿儒机械有限公司 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛婚外情取证-青岛王军侦探事务所 | 尚为传动-专业高精密蜗轮蜗杆,双导程蜗轮蜗杆,蜗轮蜗杆减速机,蜗杆减速机生产厂家 | 深圳市东信高科自动化设备有限公司| 冷轧机|两肋冷轧机|扁钢冷轧机|倒立式拉丝机|钢筋拔丝机|收线机-巩义市华瑞重工机械制造有限公司 | 【孔氏陶粒】建筑回填陶粒-南京/合肥/武汉/郑州/重庆/成都/杭州陶粒厂家 | 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 储能预警-储能消防系统-电池舱自动灭火装置-四川千页科技股份有限公司官网 | 涡轮流量计_LWGY智能气体液体电池供电计量表-金湖凯铭仪表有限公司 | 日本SMC气缸接头-速度控制阀-日本三菱伺服电机-苏州禾力自动化科技有限公司 | 篷房|仓储篷房|铝合金篷房|体育篷房|篷房厂家-华烨建筑科技官网 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 紫外可见光分光度计-紫外分光度计-分光光度仪-屹谱仪器制造(上海)有限公司 | 盘古网络技术有限公司| 耐酸泵,耐腐蚀真空泵,耐酸真空泵-淄博华舜耐腐蚀真空泵有限公司 精密模具-双色注塑模具加工-深圳铭洋宇通 |