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

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

<legend id='LSYci'><style id='LSYci'><dir id='LSYci'><q id='LSYci'></q></dir></style></legend>

    <tfoot id='LSYci'></tfoot>

        <bdo id='LSYci'></bdo><ul id='LSYci'></ul>

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

        使用 Leaflet.js 和 OSM 時僅顯示美國

        Show only United States when using Leaflet.js and OSM(使用 Leaflet.js 和 OSM 時僅顯示美國)
        1. <legend id='vsbMK'><style id='vsbMK'><dir id='vsbMK'><q id='vsbMK'></q></dir></style></legend>
        2. <small id='vsbMK'></small><noframes id='vsbMK'>

          <tfoot id='vsbMK'></tfoot>

              <bdo id='vsbMK'></bdo><ul id='vsbMK'></ul>

                <tbody id='vsbMK'></tbody>
                • <i id='vsbMK'><tr id='vsbMK'><dt id='vsbMK'><q id='vsbMK'><span id='vsbMK'><b id='vsbMK'><form id='vsbMK'><ins id='vsbMK'></ins><ul id='vsbMK'></ul><sub id='vsbMK'></sub></form><legend id='vsbMK'></legend><bdo id='vsbMK'><pre id='vsbMK'><center id='vsbMK'></center></pre></bdo></b><th id='vsbMK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vsbMK'><tfoot id='vsbMK'></tfoot><dl id='vsbMK'><fieldset id='vsbMK'></fieldset></dl></div>
                  本文介紹了使用 Leaflet.js 和 OSM 時僅顯示美國的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Leaflet.js 和 OSM 圖塊來創(chuàng)建地圖,但我只希望看到美國大陸,而不是整個世界.這可能嗎?

                  I'm using leaflet.js and OSM tiles to create a map, but I'd only like the continental United States to be viewable, not the entire world. Is that possible?

                  我正在像這樣加載地圖:

                  I'm loading the map like this:

                  var map = L.map('map').setView([39.82, -98.58], 5);
                  
                  L.tileLayer('http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
                      attribution: '...',
                      maxZoom: 18
                  }).addTo(map);
                  

                  推薦答案

                  這是可能的,而且很容易做到.首先,您需要美國大陸邊界框(最外邊緣)的坐標.你可以用谷歌搜索它們,我在這里找到它們:http://isithackday.com/geoplanet-explorer/index.php?woeid=24865672 您需要西南和東北坐標來創(chuàng)建邊界對象:

                  That's possible and easy to do. First of you'll need the coordinates for the bounding box (the outermost edges) of the continental united states. You can just google them, i found them here: http://isithackday.com/geoplanet-explorer/index.php?woeid=24865672 You need the southwest and northeast coordinates to create a bounds object:

                  var maxBounds = L.latLngBounds(
                      L.latLng(5.499550, -167.276413), //Southwest
                      L.latLng(83.162102, -52.233040)  //Northeast
                  );
                  

                  或者您可以使用簡寫版本,即嵌套數(shù)組:

                  Or you can go for the shorthand version, a nested array:

                  var maxBounds = [
                      [5.499550, -167.276413], //Southwest
                      [83.162102, -52.233040]  //Northeast
                  ];
                  

                  現(xiàn)在您可以通過兩種方式在地圖上設置它們,初始化時,使用 maxBounds 選項和 L.MapfitBounds 方法>

                  Now you can set those on your map in two ways, upon initialization, using the maxBounds option and the fitBounds method of L.Map

                  L.map('map', {
                      'center': [0, 0],
                      'zoom': 0
                      'maxBounds': maxBounds
                  }).fitBounds(maxBounds);
                  

                  這是一個關于 Plunker 的工作示例:http://plnkr.co/edit/eEsxeh?p=預覽

                  Here's a working example on Plunker: http://plnkr.co/edit/eEsxeh?p=preview

                  或者當您的地圖已經(jīng)初始化時,您可以使用 L.MapsetMaxBounds 方法和 fitBounds 方法.(假設您的地圖已分配給變量 map):

                  Or when your map is already initialized you can use the setMaxBounds method and the fitBounds method of L.Map. (assuming your map is assigned to variable map):

                  map.setMaxBounds(maxBounds);
                  map.fitBounds(maxBounds);
                  

                  這是一個關于 Plunker 的工作示例:http://plnkr.co/edit/HJKk0O?p=預覽

                  Here's a working example on Plunker: http://plnkr.co/edit/HJKk0O?p=preview

                  這篇關于使用 Leaflet.js 和 OSM 時僅顯示美國的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個多邊形點是否在傳單中的另一個內(nèi)部)
                  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 中的默認加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)

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

                          <tbody id='8QNCK'></tbody>
                        <legend id='8QNCK'><style id='8QNCK'><dir id='8QNCK'><q id='8QNCK'></q></dir></style></legend>
                          • <bdo id='8QNCK'></bdo><ul id='8QNCK'></ul>

                            <small id='8QNCK'></small><noframes id='8QNCK'>

                          • <tfoot id='8QNCK'></tfoot>
                          • 主站蜘蛛池模板: 观看av| 99免费在线视频 | 亚洲国产黄色av | 日韩精品一区二区三区在线播放 | 色婷婷综合久久久中字幕精品久久 | 中文字幕在线看人 | 亚洲综合无码一区二区 | 欧美成人精品一区二区男人看 | 波多野吉衣在线播放 | 国产高清视频在线播放 | 国产精品无码久久久久 | 91麻豆精品一区二区三区 | 天天插天天射天天干 | 国产在线小视频 | av中文字幕在线 | 国产精品美女久久久久久免费 | 久久久高清 | 国产精品视频久久久久久 | 91精品国产综合久久久久久 | 欧美一级在线免费观看 | 视频一区在线播放 | 亚洲精品9999| 蜜臀网 | 成人在线日韩 | 国产高清视频在线观看 | 亚洲一区二区视频在线播放 | 国产一区二区久久 | 久久久精品| 国产精品毛片久久久久久 | www.色五月.com| 国产欧美一区二区在线观看 | 国产一级片网站 | 蜜桃免费av | 一区二区免费在线视频 | 欧美日韩一区二区三区不卡视频 | 一级黄色录像毛片 | 久久国产精品免费一区二区三区 | 国产精品久久久久久 | 欧美精品久久久久久久久老牛影院 | 久久久久久久久久久福利观看 | 国产91丝袜在线18 |