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

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

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

        如何強(qiáng)制傳單地圖重新加載所有圖塊,包括可見

        How do I force a leaflet map to reload all tiles including visible ones?(如何強(qiáng)制傳單地圖重新加載所有圖塊,包括可見圖塊?)
          <tbody id='SrUGR'></tbody>

          • <bdo id='SrUGR'></bdo><ul id='SrUGR'></ul>
            <tfoot id='SrUGR'></tfoot><legend id='SrUGR'><style id='SrUGR'><dir id='SrUGR'><q id='SrUGR'></q></dir></style></legend>

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

                <i id='SrUGR'><tr id='SrUGR'><dt id='SrUGR'><q id='SrUGR'><span id='SrUGR'><b id='SrUGR'><form id='SrUGR'><ins id='SrUGR'></ins><ul id='SrUGR'></ul><sub id='SrUGR'></sub></form><legend id='SrUGR'></legend><bdo id='SrUGR'><pre id='SrUGR'><center id='SrUGR'></center></pre></bdo></b><th id='SrUGR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SrUGR'><tfoot id='SrUGR'></tfoot><dl id='SrUGR'><fieldset id='SrUGR'></fieldset></dl></div>
                  本文介紹了如何強(qiáng)制傳單地圖重新加載所有圖塊,包括可見圖塊?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在開發(fā)一個(gè)圖形網(wǎng)絡(luò)應(yīng)用程序,我已經(jīng)決定傳單可以制作一個(gè)不錯(cuò)的圖形視圖.我讓它顯示(有點(diǎn)),但我需要一種方法來強(qiáng)制它在用戶輸入新公式進(jìn)行圖形時(shí)更新.

                  I'm working on a graphing web-app and I've decided that leaflet would make a decent graph view. I have it displaying (sort of) but I need a way to force it to update when the user enters a new formula to graph.

                  我也在使用 JQuery,但這不重要.以下是相關(guān)代碼:

                  I'm using JQuery as well, but that shouldn't matter. Here is the relevant code:

                  function formulaChange(formula){
                       //submits a request to the server to add a graph to display
                       map.setView(map.getCenter(),map.getZoom(),true);//doesn't work
                       //and neither does:
                       //map.fire('viewreset');
                       //tiles.redraw();
                  }
                  
                  function enterHandler(event){
                      if(event.keyCode==13){
                          formulaChange(document.getElementById("formula").value);
                      }
                  
                  }
                  
                  var map;
                  var tiles;
                  $(document).ready(function(){
                      map=L.map('plot',{crs:L.CRS.Simple}).setView([0,0],10);
                      //url is actually a servlet on the server that generates an image on the fly
                      tiles = L.tileLayer('./GraphTile.png?x={x}&y={y}&z={z}&tilesize={tileSize}&{s}', 
                      {
                          maxZoom: 20,
                          continuousWorld: true,
                          tileSize: 128,
                          //subdomains used as a random in the URL to prevent caching
                          subdomains: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
                      }
                      ).addTo(map);
                  });
                  

                  這有效,但在用戶單擊時(shí)不會(huì)刷新,事件肯定正在運(yùn)行(我省略了其他更新文本顯示的代碼).它顯示正確,但是當(dāng)用戶添加一個(gè)功能來顯示視圖永遠(yuǎn)不會(huì)更新并且傳單繼續(xù)顯示緩存的圖像時(shí),只有新的縮放級(jí)別或平移到從未查看過的區(qū)域會(huì)導(dǎo)致它更新圖塊.我的問題是:如何強(qiáng)制傳單完全重新加載所有內(nèi)容并刪除并重新加載所有圖像?

                  This works but won't refresh when the user clicks, the event is definitely running (I've omitted other code that updates a text display). It displays properly, but when the user adds a function to display the view never updates and leaflet continues to display cached images, only a new zoom level or panning to an area never before viewed causes it to update the tiles. The question I have is: How do I force leaflet to completely reload everything and drop and reload all the images?

                  EDIT 添加了另一個(gè)失敗的嘗試

                  EDIT added another failed attempt

                  推薦答案

                  我找到了答案.盡管沒有緩存標(biāo)頭,但我的瀏覽器仍在緩存圖像.子域不是文檔聲稱的隨機(jī)選擇",它們是使用瓦片位置的哈希生成的.所以我不得不臨時(shí)想出一種方法來將&RANDOM##"添加到 URL 的末尾而不是子域.

                  I found the answer. Despite the no-cache headers my browser was caching the images anyway. The subdomains are not "randomly chosen" as the documentation claims, they are generated using a hash of the tile location. So I had to improvise a way to add "&RANDOM##" to the end of the URL instead of the subdomain.

                  新代碼如下所示:

                  function enterHandler(event){
                      if(event.keyCode==13){
                          formulaChange(document.getElementById("formula").value);
                      }
                  }
                  function formulaChange(formula){
                      val.item=Math.random();
                      tiles.redraw();
                  }
                  var map;
                  var tiles;
                  var val={
                      item: Math.random(),
                      toString: function(){
                          return this.item;
                      }
                  };
                  $(document).ready(function(){
                      map=L.map('plot',{crs:L.CRS.Simple}).setView([0,0],10);
                      tiles = L.tileLayer('./GraphTile.png?x={x}&y={y}&z={z}&tilesize={tileSize}&{test}', 
                      {
                          maxZoom: 20,
                          continuousWorld: true,
                          tileSize: 128,
                          test: val
                      }
                      ).addTo(map);
                  });
                  

                  希望這對(duì)其他人有所幫助.如果有更好的方法,請(qǐng)發(fā)表評(píng)論.

                  Hope this helps someone else. Please comment if there's a better way to do this.

                  這篇關(guān)于如何強(qiáng)制傳單地圖重新加載所有圖塊,包括可見圖塊?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(nèi)部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                  Trigger click on leaflet marker(觸發(fā)點(diǎn)擊傳單標(biāo)記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側(cè)邊欄)
                  <i id='jjTDC'><tr id='jjTDC'><dt id='jjTDC'><q id='jjTDC'><span id='jjTDC'><b id='jjTDC'><form id='jjTDC'><ins id='jjTDC'></ins><ul id='jjTDC'></ul><sub id='jjTDC'></sub></form><legend id='jjTDC'></legend><bdo id='jjTDC'><pre id='jjTDC'><center id='jjTDC'></center></pre></bdo></b><th id='jjTDC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jjTDC'><tfoot id='jjTDC'></tfoot><dl id='jjTDC'><fieldset id='jjTDC'></fieldset></dl></div>
                  • <bdo id='jjTDC'></bdo><ul id='jjTDC'></ul>

                    1. <small id='jjTDC'></small><noframes id='jjTDC'>

                            <tbody id='jjTDC'></tbody>
                          <legend id='jjTDC'><style id='jjTDC'><dir id='jjTDC'><q id='jjTDC'></q></dir></style></legend>
                            <tfoot id='jjTDC'></tfoot>
                            主站蜘蛛池模板: 色综合视频在线观看 | 国产高清av | 日韩黄色一级 | 91免费黄| 99视频在线观看免费 | 熟女毛片 | 国产精品一区av | 亚洲免费看片 | 天天天操 | 欧美国产在线视频 | 国产成人av网站 | 一区二区毛片 | 中文字幕在线视频播放 | 久久久一 | 国产精品福利视频 | 日本丰满肉感bbwbbwbbw | 999精品在线 | 国产精品久久久久久久久 | 欧美成人精品激情在线观看 | 日韩免费小视频 | 亚洲精品成人网 | 91亚洲国产 | 精品99视频 | 中文字幕网址在线 | 国产精品一区二区三 | 亚洲a级片| 男女激情视频网站 | 成人三级在线观看 | 手机av免费 | 国产欧美日韩视频 | 欧美在线网址 | 亚洲国产日韩在线 | 午夜xxx | 黄色网址在线播放 | 深夜免费福利 | 夜夜操狠狠操 | 五月天久久久 | 久久久久久av | 国产剧情一区 | 亚洲精品91天天久久人人 | 亚洲视频中文字幕 |