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

        <tfoot id='ZfGSt'></tfoot>
      1. <small id='ZfGSt'></small><noframes id='ZfGSt'>

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

          <bdo id='ZfGSt'></bdo><ul id='ZfGSt'></ul>
        <legend id='ZfGSt'><style id='ZfGSt'><dir id='ZfGSt'><q id='ZfGSt'></q></dir></style></legend>

      3. Angular 6 - 如何在組件級別應用外部 CSS 樣式表(傳

        Angular 6 - How to apply external css stylesheet (leaflet) at component level?(Angular 6 - 如何在組件級別應用外部 CSS 樣式表(傳單)?)
      4. <i id='UiUle'><tr id='UiUle'><dt id='UiUle'><q id='UiUle'><span id='UiUle'><b id='UiUle'><form id='UiUle'><ins id='UiUle'></ins><ul id='UiUle'></ul><sub id='UiUle'></sub></form><legend id='UiUle'></legend><bdo id='UiUle'><pre id='UiUle'><center id='UiUle'></center></pre></bdo></b><th id='UiUle'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UiUle'><tfoot id='UiUle'></tfoot><dl id='UiUle'><fieldset id='UiUle'></fieldset></dl></div>
          <tfoot id='UiUle'></tfoot>
            <bdo id='UiUle'></bdo><ul id='UiUle'></ul>
          • <legend id='UiUle'><style id='UiUle'><dir id='UiUle'><q id='UiUle'></q></dir></style></legend>

                <tbody id='UiUle'></tbody>

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

                  本文介紹了Angular 6 - 如何在組件級別應用外部 CSS 樣式表(傳單)?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  嘗試在 Angular 6 組件中使用 Leaflet.根據 css 文件的鏈接方式,地圖顯示正?;蚧靵y,丟失的圖塊順序不正確,這意味著 css 未被考慮在內.

                  Trying to use Leaflet in an Angular 6 component. Depending on how the css file is linked, the map shows ok or is messed up, there are missing tiles not in the right order, which means the css is not taken into account.

                  我設法使它與將 css 鏈接到應用程序級別(全局)的 2 個解決方案一起工作,但絕不只鏈接到組件.這是我嘗試過的(除了閱讀了幾篇關于 css/leaflet/Angular 的帖子):

                  I managed to make it work with 2 solutions linking the css to the application level (global), but never only to the component. Here's what I tried (in addition to reading several posts about css/leaflet/Angular):

                  工作過 - 全球層面:

                  // styles.css
                  @import url("assets/lib/leaflet/leaflet.css");
                  

                  工作過 - 全球層面:

                  // index.html
                  <link rel="stylesheet" href="./assets/lib/leaflet/leaflet.css" type="text/css">
                  

                  無效 - 全局級別:

                  // angular.json
                  "styles": [
                      "src/styles.css",
                      "src/assets/lib/leaflet/leaflet.css"
                  ],
                  

                  不起作用 - 組件級別:

                  // ...
                  
                  import * as L from "../assets/lib/leaflet/leaflet.js";
                  import "../assets/lib/leaflet/leaflet-bing-layer.js";
                  import { BingHelper } from "../assets/lib/bing/bing-helper.js";
                  
                  // -> importing the .css file here does not work
                  
                  @Component({
                      templateUrl: "./map.component.html",
                      selector: "app-map",
                      styleUrls: ["../assets/lib/leaflet/leaflet.css"] // -> does not work
                  
                      // -> also tried to put the content of the .css in style: "", did not work neither
                  
                  })
                  export class MapComponent implements AfterViewInit {
                      ngAfterViewInit() {
                          var map = L.map("map", {
                              attributionControl: false,
                              zoom: 8,
                              minZoom: 3,
                              maxZoom: 15,
                              center: new L.LatLng(40.737, -73.923)
                          });
                          // ...
                  

                  不起作用:封裝 - 組件級別:將外部css樣式加載到Angular 2組件中

                  Did not work: encapsulation - component level: Load external css style into Angular 2 Component

                  從 CDN 加載而不是本地文件不會改變問題.

                  Loading from CDN instead of local file does not change the issue.

                  注意:我正在使用 Bing 層擴展,但這對此問題沒有影響.我也有同樣的問題,而是使用 Mapbox 瓦片.

                  問題:有沒有辦法將 Leaflet css 鏈接到組件中,并使其僅可用于該組件,而不能用于整個 Angular 應用程序?

                  Question: is there a way to link Leaflet css in a component and make it only available to the component, but not to the whole Angular application?

                  謝謝!

                  推薦答案

                  好的,這就是有效的方法(感謝@Palsri,我再次閱讀了博客文章和 Angular 樣式指南,并嘗試了以下方法,效果很好):

                  Ok, here's what worked (thanks @Palsri, I read once more the blog post and the Angular styling guidelines and tried the following, which worked):

                  在單獨的 css 文件中,導入傳單 css:

                  In a separate css file, import the leaflet css:

                  // map.component.css
                  @import url("../assets/lib/leaflet/leaflet.css");
                  
                  .mapstyle {
                      width: 100%;
                      height:100%;
                  };
                  

                  然后在組件中,引用這個css而不是leaflet css,如下:

                  Then in the component, reference this css instead of the leaflet css as follows:

                  @Component({
                      templateUrl: "./map.component.html",
                      selector: "app-map",
                      styleUrls: ["./map.component.css"],
                      encapsulation: ViewEncapsulation.None
                  })
                  

                  這是html模板中的代碼:

                  Here's the code in the html template:

                  <div id="map" class="mapstyle"></div>
                  

                  還有一件事:要使高度 % 起作用,您需要定義父母的大小,我目前在 index.html 中這樣做如下:

                  One more thing: for the height % to work, you need to define the parents size, which I currently did in the index.html as follows:

                  <style>
                  html, body {
                      min-height: 100% !important;
                      height:     100%;
                      padding: 0px 0px 0px 0px;
                      margin:  0px 0px 0px 0px;
                  }
                  </style>
                  

                  希望這會有所幫助.

                  這篇關于Angular 6 - 如何在組件級別應用外部 CSS 樣式表(傳單)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 圖層控件添加到側邊欄)
                  <i id='hNNal'><tr id='hNNal'><dt id='hNNal'><q id='hNNal'><span id='hNNal'><b id='hNNal'><form id='hNNal'><ins id='hNNal'></ins><ul id='hNNal'></ul><sub id='hNNal'></sub></form><legend id='hNNal'></legend><bdo id='hNNal'><pre id='hNNal'><center id='hNNal'></center></pre></bdo></b><th id='hNNal'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hNNal'><tfoot id='hNNal'></tfoot><dl id='hNNal'><fieldset id='hNNal'></fieldset></dl></div>

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

                          <tfoot id='hNNal'></tfoot>
                            <tbody id='hNNal'></tbody>

                          <legend id='hNNal'><style id='hNNal'><dir id='hNNal'><q id='hNNal'></q></dir></style></legend>
                          • <bdo id='hNNal'></bdo><ul id='hNNal'></ul>
                            主站蜘蛛池模板: 成人精品一区二区 | 国产精品久久777777 | 欧美中文一区 | 免费天天干 | 国产一区二区三区在线免费 | 亚洲欧美中文日韩在线v日本 | 午夜激情视频在线 | 久久久久久久国产 | 成人在线视频免费播放 | www日日日 | 中文字幕精品一区二区三区精品 | 日本电影一区二区 | www.狠狠干| 亚洲一区视频在线 | 中文字幕第一页在线 | 色综合天天网 | 欧美黄色性生活视频 | 国产高清在线精品一区二区三区 | 一区在线视频 | 午夜看看 | 久久国产婷婷国产香蕉 | 99综合| 中文字幕视频在线 | 免费成人高清 | 99re在线免费视频 | 国产一区视频在线 | 国产丝袜人妖cd露出 | 国产精品美女久久久久久免费 | 久久国产精品网 | av色在线 | 中文字幕一区二区三区四区 | 日韩在线中文 | 午夜精品一区二区三区免费视频 | 国产精品无 | 成人免费一区二区三区视频网站 | 国产亚洲网站 | 久久日本 | 日韩a视频| 91精品国产色综合久久 | 色女人天堂 | www视频在线观看 |