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

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

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

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

      Leaflet maxBounds - 邊界不起作用

      Leaflet maxBounds - bounds do not work(Leaflet maxBounds - 邊界不起作用)

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

        1. <tfoot id='xJYfG'></tfoot>
              <tbody id='xJYfG'></tbody>
          • <i id='xJYfG'><tr id='xJYfG'><dt id='xJYfG'><q id='xJYfG'><span id='xJYfG'><b id='xJYfG'><form id='xJYfG'><ins id='xJYfG'></ins><ul id='xJYfG'></ul><sub id='xJYfG'></sub></form><legend id='xJYfG'></legend><bdo id='xJYfG'><pre id='xJYfG'><center id='xJYfG'></center></pre></bdo></b><th id='xJYfG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xJYfG'><tfoot id='xJYfG'></tfoot><dl id='xJYfG'><fieldset id='xJYfG'></fieldset></dl></div>
            <legend id='xJYfG'><style id='xJYfG'><dir id='xJYfG'><q id='xJYfG'></q></dir></style></legend>
                <bdo id='xJYfG'></bdo><ul id='xJYfG'></ul>
                本文介紹了Leaflet maxBounds - 邊界不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我用 我在 Mapbox 找到的示例代碼嘗試了 Leafletjs maxBounds.

                您可以在下面找到我的完整代碼,也在 jsfiddle here 中.

                Below you find my complete code, also in a jsfiddle here.

                <!DOCTYPE HTML>
                <html>
                <head>
                    <title>map - leaflet test bounds</title>
                        <meta charset="UTF-8">
                        <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui" />
                        <meta http-equiv="X-UA-Compatible" content="IE=edge">
                
                        <!-- leafletjs -->
                        <link rel="stylesheet"  />
                        <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
                
                        <style>
                            body {
                                margin: 0;
                                padding: 0;
                            }
                            html, body, #map {
                                height: 100%;
                                width: 100%;
                            }
                        </style>
                </head>
                
                <body>
                    <div id="map">
                        <script>
                
                            var southWest = L.latLng(40.712, -74.227),
                                northEast = L.latLng(40.774, -74.125),
                                mybounds = L.latLngBounds(southWest, northEast);
                
                            var map = L.map('map').setView([40.743, -74.176], 17);
                            L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png' , {
                                maxBounds: mybounds,
                                maxZoom: 18,
                                minZoom: 16,
                                attribution: '&copy; <a >OpenStreetMap</a> contributors'
                            }) .addTo(map);
                
                            L.marker([40.743, -74.176]) .addTo(map);
                
                        </script>
                    </div>        
                </body>
                

                jsfiddle 結果看起來很奇怪,我不知道為什么.

                The jsfiddle result looks odd, I don't know why.

                為什么上面的代碼不像 Mapbox 的例子那樣工作?

                Why doesn't the upper code work like the Mapbox example?

                推薦答案

                你必須使用 bounds 作為 L.tileLayer 的選項,而不是 maxBounds.

                You must use bounds as an option of L.tileLayer, and not maxBounds.

                邊界參考

                另外,您似乎在 JSFiddle 中為 leaflet.css 加載了錯誤的文件,正確的來源是:http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css

                Also, it seems you've loaded a wrong file for the leaflet.css in JSFiddle, the correct source is this: http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css

                最后,避免在 JSFiddle 中使用百分比大小,而是使用像素大小.這是一個有效的 JSFiddle:http://jsfiddle.net/1zyL4q4a/4/

                Finally, avoid to use percent sizes in JSFiddle, use pixel ones instead. Here's a working JSFiddle: http://jsfiddle.net/1zyL4q4a/4/

                 L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png' , {
                            bounds: mybounds,
                            maxZoom: 18,
                            minZoom: 16,
                            attribution: '&copy; <a >OpenStreetMap</a> contributors'
                  }).addTo(map);
                

                這篇關于Leaflet maxBounds - 邊界不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關文檔推薦

                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(觸發(fā)點擊傳單標記)
                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 - 在彈出窗口中獲取標記的緯度和經(jīng)度)

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

                  <legend id='y7rhe'><style id='y7rhe'><dir id='y7rhe'><q id='y7rhe'></q></dir></style></legend>
                1. <tfoot id='y7rhe'></tfoot>
                      <tbody id='y7rhe'></tbody>
                      <bdo id='y7rhe'></bdo><ul id='y7rhe'></ul>

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

                          主站蜘蛛池模板: 久久久久国 | 夜夜操天天艹 | 国产精品免费一区二区三区四区 | 男女视频在线免费观看 | 一区二区精品在线 | 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 精品国产一区二区三区四区在线 | 亚洲精品日韩在线 | 99久久久久久99国产精品免 | 国产激情视频在线 | 操到爽| 国产视频久久 | 日韩视频二区 | 亚洲三区在线观看 | 久久久久久成人 | 日韩国产欧美一区 | 成人国产精品入口免费视频 | 久久综合一区 | 特级特黄特色的免费大片 | 欧美一级片在线 | 国产亚洲精品一区二区三区 | 中文字幕11页 | 国产精品视频专区 | 日韩精品一区二区三区中文在线 | 99热热热 | 国产91丝袜在线播放 | 色资源在线 | 国产高清在线精品一区二区三区 | 国内久久 | japanhdxxxx裸体| 日本久久福利 | 亚洲精品一区二区网址 | 91精品国产综合久久久久久 | 欧美一级片在线看 | 中文字幕韩在线第一页 | 日韩精品一区二区三区高清免费 | 91在线精品秘密一区二区 | 一区二区视频在线 | 成人福利网 | 成人精品久久 | 久久久国产亚洲精品 |