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

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

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

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

        <tfoot id='did4g'></tfoot>

        如何將 Leaflet 地圖嵌入到 Reveal.js 演示文稿中?

        How to embed a Leaflet map into a Reveal.js presentation?(如何將 Leaflet 地圖嵌入到 Reveal.js 演示文稿中?)
        • <small id='i3xix'></small><noframes id='i3xix'>

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

                  <i id='i3xix'><tr id='i3xix'><dt id='i3xix'><q id='i3xix'><span id='i3xix'><b id='i3xix'><form id='i3xix'><ins id='i3xix'></ins><ul id='i3xix'></ul><sub id='i3xix'></sub></form><legend id='i3xix'></legend><bdo id='i3xix'><pre id='i3xix'><center id='i3xix'></center></pre></bdo></b><th id='i3xix'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i3xix'><tfoot id='i3xix'></tfoot><dl id='i3xix'><fieldset id='i3xix'></fieldset></dl></div>
                  本文介紹了如何將 Leaflet 地圖嵌入到 Reveal.js 演示文稿中?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試創建一個在 Reveal.js 之上運行的演示文稿,該演示文稿將在其中一張幻燈片中包含一個 Leaflet.js 地圖.我已經包含了所有必要的 Javascript &CSS 文件到我的 Reveal.js 演示文稿中,我可以使地圖出現在幻燈片上.

                  I am trying to create a presentation running on top of Reveal.js, which would include a Leaflet.js map within one of the slides. I have included all necessary Javascript & CSS files into my Reveal.js presentation and I can make the map appear on the slide.

                  但是,問題是:地圖圖塊顯示不正確.我看到的不是實際的地圖圖塊,而是灰色背景和一些水平黑線.我可以放大/縮小并平移地圖,并且黑線會相應移動.

                  However, the problem is: map tiles are not displayed correctly. Instead of the actual map tiles, all I am seeing is gray background and some horizontal black lines. I can zoom in/out and pan the map, and the black lines are moving accordingly.

                  Javascript 控制臺中沒有錯誤消息,并且瀏覽器似乎正在按照應有的方式從服務器下載地圖圖塊.我相信這個問題與 Leaflet 地圖圖塊的 CSS 代碼有關 - .leaflet-tile 在 leaflet.css 中 - 在某種程度上與 Reveal.js 不兼容.

                  There are no error message in the Javascript console, and the browser seems to be downloading map tiles from server exactly as it should. I believe the problem has something to do with the CSS code of Leaflet map tiles - .leaflet-tile within leaflet.css - being somehow incompatible with Reveal.js.

                  問題是:有誰知道如何解決這個問題?還是沒有解決辦法的死胡同?

                  The question is: Does anyone know how to get around this issue? Or is it a deadend with no possible solution?

                  <div id="map"> 我有以下 CSS:

                  #map {
                      height:400px;
                      width:100%;
                  }
                  

                  一個明顯的解決方法是使用 <iframe> 標簽將地圖嵌入到演示文稿中.似乎工作得很好,也許將框架分開會更好.然而,不利的一面是,如果演示文稿中有多個地圖,每個地圖都在其自己的 <iframe> 中,則 Leaflet.js 的副本會為每個 iframe 加載到內存中.

                  One obvious workaround for this is to use <iframe> tag to embed the map into the presentation. Seems to work just fine, and maybe it is better to keep the frameworks separated. However, the downside is that if there are several maps in the presentation, each within its own <iframe>, a copy of Leaflet.js is loaded to memory for each and every iframe.

                  編輯 #2: 一個更好的解決方案似乎是使用 PolymapsLeaflet.js.似乎可以將多個 Polymaps 地圖嵌入到 reveal.js 演示文稿中.沒有問題.

                  EDIT #2: A better solution, it seems, is to use Polymaps instead of Leaflet.js. It seems that several Polymaps maps can be embedded into a reveal.js presentaion. No issues.

                  推薦答案

                  我發現用 web 組件很容易做到,這樣,shadow dom 將保護我的傳單地圖免受揭示 css 的邪惡之手

                  I found it easily to do it with a web component, this way, the shadow dom will protect my leaflet map from the evil hands of reveals css

                  這是一個帶有示例的倉庫

                  <link rel="import" href="./leaflet-map.html">
                  ...
                  <div class="reveal">
                    <div class="slides">
                      <section data-state="map">
                         <leaflet-map></leaflet-map>
                      </section>
                    </div>
                  </div>
                  

                  這是網頁組件

                  <template id="leaflet-map-template">
                  <link rel="stylesheet" href="./bower_components/leaflet/dist/leaflet.css">
                  <div id="mapid" style="height: 500px"></div>
                      <!-- LEAFLET JS -->
                  </template>
                  <script src="./bower_components/leaflet/dist/leaflet.js"></script>
                  <script>
                      class LeafletMap extends HTMLElement {
                          constructor () {
                              super();
                              let tmpl = document.currentScript.ownerDocument.querySelector('template')
                              let shadowRoot = this.attachShadow({mode: 'open'})
                              shadowRoot.appendChild(tmpl.content.cloneNode(true))
                  
                              let mapDiv = this.shadowRoot.getElementById('mapid')
                              this.map = L.map(mapDiv).setView([19.39682052576622, -99.13478851318361], 13)
                              // this.setAttribute('map', map)
                              // Tiles de open street maps
                              //L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(map)
                  
                              L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
                                  maxZoom: 18,
                                  attribution: 'Map data &copy; <a >OpenStreetMap</a> contributors, ' +
                                      '<a  +
                                      'Imagery ? <a ,
                                  id: 'mapbox.streets'
                              }).addTo(this.map)
                              let myIcon = L.icon({
                                  iconUrl: './lentes.png',
                  
                                  iconSize:     [40, 40], // size of the icon
                                  iconAnchor:   [20, 20], // point of the icon which will correspond to marker's location
                                  tooltipAnchor: [20,0]
                              })
                              L.marker(
                                  [19.418657758792698, -99.14065182209016],
                                  {icon: myIcon}
                              ).bindTooltip('Ranchito').addTo(this.map)
                          }
                  
                          resize() {
                              this.map.invalidateSize()
                          }
                      }
                      window.customElements.define('leaflet-map', LeafletMap)
                  </script>
                  

                  這篇關于如何將 Leaflet 地圖嵌入到 Reveal.js 演示文稿中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                  <tfoot id='7zGpP'></tfoot>

                      <bdo id='7zGpP'></bdo><ul id='7zGpP'></ul>

                          <small id='7zGpP'></small><noframes id='7zGpP'>

                          1. <legend id='7zGpP'><style id='7zGpP'><dir id='7zGpP'><q id='7zGpP'></q></dir></style></legend>
                          2. <i id='7zGpP'><tr id='7zGpP'><dt id='7zGpP'><q id='7zGpP'><span id='7zGpP'><b id='7zGpP'><form id='7zGpP'><ins id='7zGpP'></ins><ul id='7zGpP'></ul><sub id='7zGpP'></sub></form><legend id='7zGpP'></legend><bdo id='7zGpP'><pre id='7zGpP'><center id='7zGpP'></center></pre></bdo></b><th id='7zGpP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7zGpP'><tfoot id='7zGpP'></tfoot><dl id='7zGpP'><fieldset id='7zGpP'></fieldset></dl></div>
                              <tbody id='7zGpP'></tbody>
                          3. 主站蜘蛛池模板: 男女一区二区三区 | 日日干夜夜操 | 国产91丝袜在线18 | 视频一区二区国产 | 欧美一区二区免费视频 | 久久综合一区 | 亚洲综合天堂网 | 三级av在线| 国产精品成人在线播放 | 黄色一级片aaa | 国产一级精品毛片 | 97人澡人人添人人爽欧美 | av一区在线 | 国产美女黄色 | 激情视频中文字幕 | 国产成人自拍av | 波多野结衣av中文字幕 | 日本在线黄色 | 国产精品九九九 | 午夜爽爽爽男女免费观看影院 | 亚洲综合首页 | 国产一区2区 | 日本特黄a级高清免费大片 特黄色一级毛片 | 国产一区| 精品中文字幕视频 | 国产高清免费视频 | 97人人澡人人爽91综合色 | 99re视频在线观看 | 成人免费黄色 | 男女国产视频 | 国产成人精品在线播放 | 欧美三级视频在线观看 | 精品国产高清一区二区三区 | 日韩在线播放网址 | 91精品久久久久久久久久入口 | 精品在线免费看 | 毛片一级片 | 国际精品鲁一鲁一区二区小说 | 久久久涩 | 亚洲九九色 | 91麻豆精品一区二区三区 |