久久久久久久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 文件的鏈接方式,地圖顯示正常或混亂,丟失的圖塊順序不正確,這意味著 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>
                            主站蜘蛛池模板: 久久成人国产精品 | 日韩视频精品在线 | 日韩久久精品视频 | 美女啪啪国产 | 久久人爽爽人爽爽 | av官网在线| 亚洲欧美精品久久 | 欧美xxxx色视频在线观看免费 | 国产精品网址 | 精品国产乱码久久久久久1区2区 | 日韩精品一区二区在线观看 | 婷婷五月色综合香五月 | 精品国产91乱码一区二区三区 | 国产日韩中文字幕 | 综合久| 黄色在线免费网站 | 久久99精品久久久久久 | 福利成人| 国产精品不卡一区 | 精品国产一区二区国模嫣然 | 国产不卡一区 | 九九伊人sl水蜜桃色推荐 | 中文在线a在线 | 久久精品欧美一区二区三区不卡 | 男人av在线| 日韩网站在线观看 | 亚洲一区二区三区在线播放 | 在线视频91 | 老头搡老女人毛片视频在线看 | 亚洲精品日韩视频 | 欧美日韩福利 | 精品一区二区三区四区视频 | 国产传媒视频在线观看 | 天天操操操操操 | 免费在线黄 | 国产精品美女久久久久久免费 | 视频一区二区在线观看 | 久久精品一区二区三区四区 | 国产99小视频 | 国产免费一区二区 | 久在线 |