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

      <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="58q0jag" 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="3xteay0" 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="w5p0o5j" id='7zGpP'><tfoot id='7zGpP'></tfoot><dl id='7zGpP'><fieldset id='7zGpP'></fieldset></dl></div>
                              <tbody id='7zGpP'></tbody>
                          3. 主站蜘蛛池模板: 液晶拼接屏厂家_拼接屏品牌_拼接屏价格_监控大屏—北京维康 | 粉末冶金注射成型厂家|MIM厂家|粉末冶金齿轮|MIM零件-深圳市新泰兴精密科技 | 新疆散热器,新疆暖气片,新疆电锅炉,光耀暖通公司 | 电主轴,车床电磨头,变频制动电机-博山鸿达特种电机 | 水冷式工业冷水机组_风冷式工业冷水机_水冷螺杆冷冻机组-深圳市普威机械设备有限公司 | 卡诺亚轻高定官网_卧室系统_整家定制_定制家居_高端定制_全屋定制加盟_定制家具加盟_定制衣柜加盟 | 利浦顿蒸汽发生器厂家-电蒸汽发生器/燃气蒸汽发生器_湖北利浦顿热能科技有限公司官网 | UV固化机_UVLED光固化机_UV干燥机生产厂家-上海冠顶公司专业生产UV固化机设备 | 河南15年专业网站建设制作设计,做网站就找郑州启凡网络公司 | 杰福伦_磁致伸缩位移传感器_线性位移传感器-意大利GEFRAN杰福伦-河南赉威液压科技有限公司 | 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 西点培训学校_法式西点培训班_西点师培训_西点蛋糕培训-广州烘趣西点烘焙培训学院 | 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 大倾角皮带机-皮带输送机-螺旋输送机-矿用皮带输送机价格厂家-河南坤威机械 | 气动|电动调节阀|球阀|蝶阀-自力式调节阀-上海渠工阀门管道工程有限公司 | 高中学习网-高考生信息学习必备平台| 化妆品加工厂-化妆品加工-化妆品代加工-面膜加工-广东欧泉生化科技有限公司 | 定制/定做衬衫厂家/公司-衬衫订做/订制价格/费用-北京圣达信 | 商用绞肉机-熟肉切片机-冻肉切丁机-猪肉开条机 - 广州市正盈机械设备有限公司 | 消防设施操作员考试报名时间,报名入口,报考条件 | 德国进口电锅炉_商用电热水器_壁挂炉_电采暖器_电热锅炉[德国宝] | 科昊仪器超纯水机系统-可成气相液氮罐-美菱超低温冰箱-西安昊兴生物科技有限公司 | 玉米深加工设备|玉米加工机械|玉米加工设备|玉米深加工机械-河南成立粮油机械有限公司 | 湖北省煤炭供应链综合服务平台| AGV叉车|无人叉车|AGV智能叉车|AGV搬运车-江西丹巴赫机器人股份有限公司 | 老城街小面官网_正宗重庆小面加盟技术培训_特色面馆加盟|牛肉拉面|招商加盟代理费用多少钱 | 【365公司转让网】公司求购|转让|资质买卖_股权转让交易平台 | 高速龙门架厂家_监控杆_多功能灯杆_信号灯杆_锂电池太阳能路灯-鑫世源照明 | 颚式破碎机,圆锥破碎机,制砂机-新乡市德诚机电制造有限公司 | 美国PARKER齿轮泵,美国PARKER柱塞泵,美国PARKER叶片泵,美国PARKER电磁阀,美国PARKER比例阀-上海维特锐实业发展有限公司二部 | 诗词大全-古诗名句 - 古诗词赏析| 退火炉,燃气退火炉,燃气热处理炉生产厂家-丹阳市丰泰工业炉有限公司 | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 紧急泄压人孔_防爆阻火器_阻火呼吸阀[河北宏泽石化] | 众能联合-提供高空车_升降机_吊车_挖机等一站工程设备租赁 | 大通天成企业资质代办_承装修试电力设施许可证_增值电信业务经营许可证_无人机运营合格证_广播电视节目制作许可证 | 蚂蚁分类信息系统 - PHP同城分类信息系统 - MayiCMS | 泰州物流公司_泰州货运公司_泰州物流专线-东鑫物流公司 | 集装箱标准养护室-集装箱移动式养护室-广州璟业试验仪器有限公司 | 常州翔天实验仪器厂-恒温振荡器-台式恒温振荡器-微量血液离心机 恒温恒湿箱(药品/保健品/食品/半导体/细菌)-兰贝石(北京)科技有限公司 |