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

  • <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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="qwawimqqmiuu" id='iouf1'><tfoot id='iouf1'></tfoot><dl id='iouf1'><fieldset id='iouf1'></fieldset></dl></div>

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

                          • 主站蜘蛛池模板: 日韩视频精品在线 | 亚洲综合在线播放 | 久久久久久久一区 | 久久久精品综合 | 精品视频久久久久久 | 欧美888 | 狠狠色综合久久丁香婷婷 | 日韩精品一区二区三区在线播放 | 国产欧美精品一区二区色综合朱莉 | 一区二区高清 | 亚洲 91 | 成人国产精品久久久 | 91av亚洲| 韩国精品在线 | 青青草网 | 精品久久国产老人久久综合 | 天天色图 | 久久久激情视频 | 在线天堂免费中文字幕视频 | 日韩精品三区 | 日韩二区 | 国产亚洲精品一区二区三区 | 国产伦一区二区三区四区 | 久久综合888 | 国产美女精品视频免费观看 | 午夜资源 | 国产免费一区二区三区免费视频 | 日本大香伊一区二区三区 | 综合另类 | 亚洲在线成人 | 69性欧美高清影院 | 精品日韩 | 日韩精品影院 | 国产精品中文 | 一级毛片在线看 | 91久久夜色精品国产网站 | 91久久国产综合久久 | 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 视频一区二区在线观看 | 日韩中文一区二区三区 | 国产精品日韩在线观看 |