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

    <legend id='Bs7Ci'><style id='Bs7Ci'><dir id='Bs7Ci'><q id='Bs7Ci'></q></dir></style></legend>

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

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

        <tfoot id='Bs7Ci'></tfoot>
        <i id='Bs7Ci'><tr id='Bs7Ci'><dt id='Bs7Ci'><q id='Bs7Ci'><span id='Bs7Ci'><b id='Bs7Ci'><form id='Bs7Ci'><ins id='Bs7Ci'></ins><ul id='Bs7Ci'></ul><sub id='Bs7Ci'></sub></form><legend id='Bs7Ci'></legend><bdo id='Bs7Ci'><pre id='Bs7Ci'><center id='Bs7Ci'></center></pre></bdo></b><th id='Bs7Ci'></th></span></q></dt></tr></i><div class="3vbjpvj" id='Bs7Ci'><tfoot id='Bs7Ci'></tfoot><dl id='Bs7Ci'><fieldset id='Bs7Ci'></fieldset></dl></div>

        Leaflet + Polymer 2 使用扭曲的瓷磚加載地圖,但適用

        Leaflet + Polymer 2 map loading with distorted tile however works with non-polymer code(Leaflet + Polymer 2 使用扭曲的瓷磚加載地圖,但適用于非聚合物代碼)
        <i id='SSSUE'><tr id='SSSUE'><dt id='SSSUE'><q id='SSSUE'><span id='SSSUE'><b id='SSSUE'><form id='SSSUE'><ins id='SSSUE'></ins><ul id='SSSUE'></ul><sub id='SSSUE'></sub></form><legend id='SSSUE'></legend><bdo id='SSSUE'><pre id='SSSUE'><center id='SSSUE'></center></pre></bdo></b><th id='SSSUE'></th></span></q></dt></tr></i><div class="br5b5zt" id='SSSUE'><tfoot id='SSSUE'></tfoot><dl id='SSSUE'><fieldset id='SSSUE'></fieldset></dl></div>
          <tbody id='SSSUE'></tbody>

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

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

            1. <legend id='SSSUE'><style id='SSSUE'><dir id='SSSUE'><q id='SSSUE'></q></dir></style></legend>
                1. <tfoot id='SSSUE'></tfoot>

                  本文介紹了Leaflet + Polymer 2 使用扭曲的瓷磚加載地圖,但適用于非聚合物代碼的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  更新:我現在已經在 代碼片段:

                  <style include="shared-styles publish-project-styles">:主持人 {顯示:塊;填充:20px;}#mapContainer{寬度:100%;高度:400px;邊框:1px 實心#0A569D;}.傳單容器{寬度:100%;高度:400px;邊框:1px 實心#0A569D;}</風格><td id="leftContainer" width="50%" style="padding: 15px;"><div id="mapContainer"></div><!-- <canvas id="mapContainer" style="width: 400px; height: 400px; 邊框: 1px solid #0A569D;"></canvas>--></td>準備好() {super.ready();讓leafmap = L.map(this.$.mapContainer).setView([48.84, 2.3], 5);L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {最大縮放:18}).addTo(leafmap);}

                  更新代碼:

                  <style include="shared-styles publish-project-styles">:主持人 {顯示:塊;填充:20px;}#mapContainer{寬度:100%;高度:400px;邊框:1px 實心#0A569D;}.傳單容器{寬度:100%;高度:400px;邊框:1px 實心#0A569D;}</風格><td id="leftContainer" width="50%" style="padding: 15px;"><div id="mapContainer"></div><!-- <canvas id="mapContainer" style="width: 400px; height: 400px; 邊框: 1px solid #0A569D;"></canvas>--></td>連接回調(){super.connectedCallback();讓leafmap = L.map(this.$.mapContainer).setView([48.84, 2.3], 5);L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {最大縮放:18}).addTo(leafmap);葉圖.invalidateSize();}

                  我確實嘗試過使用內聯 CSS,將 JS 放入 connectedcallback() &ready(),將 CSS 放入父元素等.

                  我假設,鑒于我閱讀的帖子存在一些 CSS 問題.但不確定.如果有人可以在這方面提供幫助,真的很感激?如果需要更多信息,請告訴我.

                  謝謝.

                  解決方案

                  Leaflet CSS 樣式不適用于陰影 DOM 元素.

                  要使其工作,您需要在此處添加leaflet.css:

                  //...<link type="text/css" rel="stylesheet" ><p>我是 x-foo 的 shadow DOM 子元素.</p>//...

                  工作示例:https://plnkr.co/edit/CJUlwUnBezum9jgt93uF?p=preview

                  UPDATE: I have now replicated this issue in Plunker. I did check the duplicate question suggested. The answer is incorrect or missing CSS file. I have imported v1.3.4 for CSS and JS as mentioned in leaflet quick start. The Plunker shows the CSS is included in Shadow DOM of the element. This is not the case for me. Also, the same version of JS and CSS works for non-polymer code, however, the distortion occurs with Polymer.

                  I am struggling for several days now to get the leaflet map loaded properly within Polymer 2. This issue is taking the soul out of me now. I have searched various threads in SO: this, Github: this, this and several other posts, unfortunately still could not fix the issue. Tested in both Chrome and Firefox. I have tried with Openlayers and the map loads perfectly. The issue arises when using Leaflet and Mapbox API. Unfortunately, due to customer requirements, cannot use Openlayers.

                  My map renders like this: Code fragments:

                  <style include="shared-styles publish-project-styles">
                      :host {
                      display: block;
                      padding: 20px;
                    }
                      #mapContainer{
                          width: 100%; height: 400px; border: 1px solid #0A569D;
                      }
                  
                      .leaflet-container{
                          width: 100%; height: 400px; border: 1px solid #0A569D;
                      }
                  </style>
                  
                  <td  id="leftContainer" width="50%" style="padding: 15px;">
                   <div id="mapContainer"></div>
                   <!-- <canvas id="mapContainer" style="width: 400px; height: 400px; border: 1px solid #0A569D;"></canvas> --></td>
                  
                  ready() {
                      super.ready();          
                      let leafmap = L.map(this.$.mapContainer).setView([48.84, 2.3], 5);
                      L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                                  maxZoom: 18
                              }).addTo(leafmap);
                  }
                  

                  UPDATED Code:

                  <style include="shared-styles publish-project-styles">
                      :host {
                      display: block;
                      padding: 20px;
                    }
                      #mapContainer{
                          width: 100%; height: 400px; border: 1px solid #0A569D;
                      }
                  
                      .leaflet-container{
                          width: 100%; height: 400px; border: 1px solid #0A569D;
                      }
                  </style>
                  
                  <td  id="leftContainer" width="50%" style="padding: 15px;">
                   <div id="mapContainer"></div>
                   <!-- <canvas id="mapContainer" style="width: 400px; height: 400px; border: 1px solid #0A569D;"></canvas> --></td>
                  
                  connectedCallback() {
                      super.connectedCallback();          
                      let leafmap = L.map(this.$.mapContainer).setView([48.84, 2.3], 5);
                      L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                                  maxZoom: 18
                              }).addTo(leafmap);
                      leafmap.invalidateSize();
                  }
                  

                  I did try with inline CSS, putting JS in connectedcallback() & ready(), putting CSS in parent element etc.

                  I am assuming, there is some CSS problem given the posts that I read. But not sure. Would really appreciate if someone could help in this regard? Please let me know if more info is needed.

                  Thanks.

                  解決方案

                  Leaflet CSS styles are not applied to shadow DOM elements.

                  To make it work you need to add leaflet.css here:

                  // ...
                  <link type="text/css" rel="stylesheet" >
                  
                  <p>I'm a shadow DOM child element of x-foo.</p>
                  // ...
                  

                  Working example: https://plnkr.co/edit/CJUlwUnBezum9jgt93uF?p=preview

                  這篇關于Leaflet + Polymer 2 使用扭曲的瓷磚加載地圖,但適用于非聚合物代碼的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中的默認加載磁貼顏色?)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標記的緯度和經度)

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

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

                            主站蜘蛛池模板: SRRC认证_电磁兼容_EMC测试整改_FCC认证_SDOC认证-深圳市环测威检测技术有限公司 | PVC地板|PVC塑胶地板|PVC地板厂家|地板胶|防静电地板-无锡腾方装饰材料有限公司-咨询热线:4008-798-128 | 华中线缆有限公司-电缆厂|电缆厂家|电线电缆厂家 | 山东限矩型液力偶合器_液力耦合器易熔塞厂家-淄博市汇川源机械厂 | 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 洗地机_全自动洗地机_手推式洗地机【上海滢皓环保】 | 立式壁挂广告机厂家-红外电容触摸一体机价格-华邦瀛 | 嘉兴泰东园林景观工程有限公司_花箱护栏 | 捆扎机_气动捆扎机_钢带捆扎机-沈阳海鹞气动钢带捆扎机公司 | 湖南自考_湖南自学考试网 | 广西绿桂涂料--承接隔热涂料、隔音涂料、真石漆、多彩仿石漆等涂料工程双包施工 | 南京精锋制刀有限公司-纵剪机刀片_滚剪机刀片_合金刀片厂家 | Trimos测长机_测高仪_TESA_mahr,WYLER水平仪,PWB对刀仪-德瑞华测量技术(苏州)有限公司 | 中红外QCL激光器-其他连续-半导体连续激光器-筱晓光子 | 新中天检测有限公司青岛分公司-山东|菏泽|济南|潍坊|泰安防雷检测验收 | 成都装修公司-成都装修设计公司推荐-成都朗煜装饰公司 | 东莞办公家具厂家直销-美鑫【免费3D效果图】全国办公桌/会议桌定制 | 骨密度仪-骨密度测定仪-超声骨密度仪-骨龄测定仪-天津开发区圣鸿医疗器械有限公司 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 深圳货架厂家_金丽声精品货架_广东金丽声展示设备有限公司官网 | 电脑知识|软件|系统|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网 | 紫外线老化试验箱_uv紫外线老化试验箱价格|型号|厂家-正航仪器设备 | 盘式曝气器-微孔曝气器-管式曝气器-曝气盘-斜管填料 | 郑州市前程水处理有限公司 | 购买舔盐、舔砖、矿物质盐压块机,鱼饵、鱼饲料压块机--请到杜甫机械 | 济南玻璃安装_济南玻璃门_济南感应门_济南玻璃隔断_济南玻璃门维修_济南镜片安装_济南肯德基门_济南高隔间-济南凯轩鹏宇玻璃有限公司 | 常州律师事务所_常州律所_常州律师-江苏乐天律师事务所 | 紧急切断阀_气动切断阀_不锈钢阀门_截止阀_球阀_蝶阀_闸阀-上海上兆阀门制造有限公司 | 环球电气之家-中国专业电气电子产品行业服务网站! | 环氧树脂地坪_防静电地坪漆_环氧地坪漆涂料厂家-地壹涂料地坪漆 环球电气之家-中国专业电气电子产品行业服务网站! | 保温杯,儿童婴童奶瓶,运动水壶「广告礼品杯定制厂家」超朗保温杯壶 | 海尔生物医疗四川代理商,海尔低温冰箱四川销售-成都壹科医疗器械有限公司 | 酒万铺-酒水招商-酒水代理 | 法兰连接型电磁流量计-蒸汽孔板节流装置流量计-北京凯安达仪器仪表有限公司 | 电动液压篮球架_圆管地埋式篮球架_移动平箱篮球架-强森体育 | 环球电气之家-中国专业电气电子产品行业服务网站! | 周口风机|周风风机|河南省周口通用风机厂 | 全自动过滤器_反冲洗过滤器_自清洗过滤器_量子除垢环_量子环除垢_量子除垢 - 安士睿(北京)过滤设备有限公司 | 汽液过滤网厂家_安平县银锐丝网有限公司| 品牌广告服务平台,好排名,好流量,好生意。 | 定硫仪,量热仪,工业分析仪,马弗炉,煤炭化验设备厂家,煤质化验仪器,焦炭化验设备鹤壁大德煤质工业分析仪,氟氯测定仪 | 火锅底料批发-串串香技术培训[川禾川调官网] |