久久久久久久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 內(nèi)定位地圖框/傳單地圖

        positioning a mapbox/leaflet map inside a container div(在容器 div 內(nèi)定位地圖框/傳單地圖)
          <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 內(nèi)定位地圖框/傳單地圖的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在一個(gè) Ruby on Rails 應(yīng)用程序中使用 Mapbox.對(duì)于我的生活,我無(wú)法讓地圖遵守任何簡(jiǎn)單的 CSS.唯一允許地圖出現(xiàn)的 CSS 是給它一個(gè)絕對(duì)位置,頂部和底部都為 0.改變高度和寬度以外的任何東西都會(huì)導(dǎo)致地圖消失.我想讓地圖在容器 div 內(nèi)居中.代碼如下:

                  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%;
                  }
                  

                  如果我改變?nèi)魏螙|西,地圖就會(huì)消失.我試圖給地圖容器 div 一個(gè)相對(duì)的位置.那是行不通的.我想要的只是將地圖包含在一個(gè) div 中,這似乎并不難.2013年有一篇關(guān)于這個(gè)的帖子,但它已經(jīng)過(guò)時(shí)了.感謝您的幫助.

                  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 設(shè)置的唯一 css 規(guī)則(Mapbox 是 Leaflet) 元素定位靜態(tài)/相對(duì)時(shí)是絕對(duì)高度:

                  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

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

                  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 示例中使用絕對(duì)定位背后的原因是不必解釋上述內(nèi)容,因?yàn)闊o(wú)論地圖元素嵌套多深,它都能正常工作.

                  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.

                  這篇關(guān)于在容器 div 內(nèi)定位地圖框/傳單地圖的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(nèi)部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                  Trigger click on leaflet marker(觸發(fā)點(diǎn)擊傳單標(biāo)記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側(cè)邊欄)
                    <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>
                          • 主站蜘蛛池模板: 中文字幕黄色 | 午夜国产在线观看 | 黄av在线| 精品国产aⅴ麻豆 | 三年中文在线观看免费大全中国 | 在线播放毛片 | 中文字幕一区二区三区在线观看 | 亚洲精品在线看 | 国产精品天堂 | 精品一区二区三区在线观看 | 黄视频在线播放 | 精品免费视频 | 精品日韩一区二区 | 男女免费视频 | av超碰在线 | 日本三级大片 | 亚洲精品久久久久久久久久久 | 日日夜夜精品免费 | 欧美成人一区二区 | 青青草福利视频 | 亚洲色吧 | аⅴ资源新版在线天堂 | 天天干视频 | 夜夜嗨av一区二区三区网页 | 亚洲最大的网站 | 免费一级黄色片 | 日韩欧美中文在线 | 黄色免费视频网站 | 色综合天天综合网国产成人网 | 谁有毛片网站 | 欧美日韩综合 | 欧美在线小视频 | 成人午夜视频在线观看 | 亚洲第一免费视频 | 成年人视频在线播放 | 亚洲免费一区二区 | 久久九九精品 | 在线视频a | 亚洲综合五月天婷婷丁香 | 亚洲性视频| 亚洲免费黄色 |