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

  • <small id='88w7v'></small><noframes id='88w7v'>

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

      • <bdo id='88w7v'></bdo><ul id='88w7v'></ul>

      <legend id='88w7v'><style id='88w7v'><dir id='88w7v'><q id='88w7v'></q></dir></style></legend>

      1. 在容器 div 內定位地圖框/傳單地圖

        positioning a mapbox/leaflet map inside a container div(在容器 div 內定位地圖框/傳單地圖)
          <i id='U0Iud'><tr id='U0Iud'><dt id='U0Iud'><q id='U0Iud'><span id='U0Iud'><b id='U0Iud'><form id='U0Iud'><ins id='U0Iud'></ins><ul id='U0Iud'></ul><sub id='U0Iud'></sub></form><legend id='U0Iud'></legend><bdo id='U0Iud'><pre id='U0Iud'><center id='U0Iud'></center></pre></bdo></b><th id='U0Iud'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='U0Iud'><tfoot id='U0Iud'></tfoot><dl id='U0Iud'><fieldset id='U0Iud'></fieldset></dl></div>

          1. <legend id='U0Iud'><style id='U0Iud'><dir id='U0Iud'><q id='U0Iud'></q></dir></style></legend>
                  <bdo id='U0Iud'></bdo><ul id='U0Iud'></ul>
                  <tfoot id='U0Iud'></tfoot>
                • <small id='U0Iud'></small><noframes id='U0Iud'>

                    <tbody id='U0Iud'></tbody>
                  本文介紹了在容器 div 內定位地圖框/傳單地圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在一個 Ruby on Rails 應用程序中使用 Mapbox.對于我的生活,我無法讓地圖遵守任何簡單的 CSS.唯一允許地圖出現的 CSS 是給它一個絕對位置,頂部和底部都為 0.改變高度和寬度以外的任何東西都會導致地圖消失.我想讓地圖在容器 div 內居中.代碼如下:

                  I am working with Mapbox in a Ruby on Rails app. For the life of me, I cannot get the map to adhere to any simple CSS. The only CSS that allows the map to appear is giving it an absolute position with a top and bottom of 0. Altering anything other than the height and width causes the map to disappear. I want to have the map centered inside a container div. Here is the code:

                  <div id="map-container">
                    <div id='map'>
                    </div>
                  </div>
                  
                  <script>
                  
                  L.mapbox.accessToken = 'pk.eyJ1IjoiYWxvb2thdG9tbW9yb3ciLCJhIjoiNGM4ODhkZjUwMGM1ZDE4M2VjNzQ4MmQ4ODcxMjk5ZjMifQ.XVvFc8kl-0z4NAblE-mNqw';
                  var map = L.mapbox.map('map', 'mapbox.streets').setView([40, -74.50], 10);
                  
                  </script>
                  

                  還有以下 CSS:

                  #map {
                    position: absolute;
                    top: 0;
                    bottom: 0;
                    height: 50%;
                    width: 50%;
                  }
                  

                  如果我改變任何東西,地圖就會消失.我試圖給地圖容器 div 一個相對的位置.那是行不通的.我想要的只是將地圖包含在一個 div 中,這似乎并不難.2013年有一篇關于這個的帖子,但它已經過時了.感謝您的幫助.

                  If I change anything, the map disappears. I have tried to give the map-container div a position of relative. That does not work. All I want is for the map to be contained within a div, it doesn't seem like it should be difficult. There is one post about this from 2013 but it is outdated. Thanks for your help.

                  推薦答案

                  必須為 Leaflet 設置的唯一 css 規則(Mapbox 是 Leaflet) 元素定位靜態/相對時是絕對高度:

                  The only css rule that must be set for Leaflet's (Mapbox is an extended version of Leaflet) element when positioned static/relative is an absolute height:

                  #map {
                      height: 200px;
                  }
                  

                  示例:http://plnkr.co/edit/vdeyLv?p=preview

                  這將始終有效,無論元素嵌套多深.如果未設置寬度,它將使用所有可用的寬度.當您想切換到以百分比設置高度時,您需要確保地圖元素的所有錨元素也都設置了高度:

                  That will work always, doesn't matter how deep the element is nested. When width is not set it will use all the width available. When you want to switch to setting height in percentages, you'll need to make sure that all the anchestor elements of the map element have a height set also:

                  #html, #body, #map-container {
                      height: 100%;
                  }
                  
                  #map {
                      height: 40%;
                  }
                  

                  示例:http://plnkr.co/edit/rAuNC0?p=preview

                  我猜想在 Mapbox 示例中使用絕對定位背后的原因是不必解釋上述內容,因為無論地圖元素嵌套多深,它都能正常工作.

                  I guess the reasoning behind using absolute positioning in the Mapbox examples is that one does not have to explain the above because no matter how deep you nest the map's element, it just works.

                  這篇關于在容器 div 內定位地圖框/傳單地圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='OXKiK'></tfoot>
                      1. <legend id='OXKiK'><style id='OXKiK'><dir id='OXKiK'><q id='OXKiK'></q></dir></style></legend>
                        <i id='OXKiK'><tr id='OXKiK'><dt id='OXKiK'><q id='OXKiK'><span id='OXKiK'><b id='OXKiK'><form id='OXKiK'><ins id='OXKiK'></ins><ul id='OXKiK'></ul><sub id='OXKiK'></sub></form><legend id='OXKiK'></legend><bdo id='OXKiK'><pre id='OXKiK'><center id='OXKiK'></center></pre></bdo></b><th id='OXKiK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OXKiK'><tfoot id='OXKiK'></tfoot><dl id='OXKiK'><fieldset id='OXKiK'></fieldset></dl></div>

                          • <bdo id='OXKiK'></bdo><ul id='OXKiK'></ul>

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

                              <tbody id='OXKiK'></tbody>
                          • 主站蜘蛛池模板: 免费国产视频在线观看 | 国产一区二区三区久久久久久久久 | 99久久夜色精品国产亚洲96 | 国产精品一区二区三区四区 | 欧美日韩中文字幕在线 | 亚洲香蕉在线视频 | 91日b| 男女羞羞的网站 | 成人国产在线视频 | 亚洲 日本 欧美 中文幕 | 久久久精彩视频 | 在线观看日韩av | 日韩在线视频一区 | 日日干夜夜干 | 高清国产午夜精品久久久久久 | 国产精品久久久久久久久久久久午夜片 | 日韩三级在线 | 欧美另类日韩 | 曰韩一二三区 | 在线看91| 成人影院免费视频 | 先锋影音资源网站 | 精品久久网 | 国产婷婷 | 亚洲国产精品视频 | 亚洲视频一区 | 日韩一区二区av | 懂色中文一区二区三区在线视频 | 欧美视频网 | 精品一二三区 | 欧美精品欧美精品系列 | 精品免费视频 | 一区二区国产精品 | 国产精品久久久久久久久 | 中文字幕日韩欧美一区二区三区 | 日朝毛片 | 国产www.| 欧洲在线视频 | 日韩免费一区二区 | 国产一级一级 | 亚洲欧美一区二区三区视频 |