pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <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="l979lbv" 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="rxhdh1z" 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模板網!

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

                相關文檔推薦

                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 中的默認加載磁貼顏色?)
                Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標記的緯度和經度)

                  <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="z9rb9z9" id='y7rhe'><tfoot id='y7rhe'></tfoot><dl id='y7rhe'><fieldset id='y7rhe'></fieldset></dl></div>

                          主站蜘蛛池模板: 诚暄电子公司首页-线路板打样,pcb线路板打样加工制作厂家 | 日本东丽膜_反渗透膜_RO膜价格_超滤膜_纳滤膜-北京东丽阳光官网 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 黑龙江京科脑康医院-哈尔滨精神病医院哪家好_哈尔滨精神科医院排名_黑龙江精神心理病专科医院 | 电竞馆加盟,沈阳网吧加盟费用选择嘉棋电竞_售后服务一体化 | 不锈钢电动球阀_气动高压闸阀_旋塞疏水调节阀_全立阀门-来自温州工业阀门巨头企业 | 滑板场地施工_极限运动场地设计_滑板公园建造_盐城天人极限运动场地建设有限公司 | 微型实验室真空泵-无油干式真空泵-微型涡旋耐腐蚀压缩机-思科涡旋科技(杭州)有限公司 | 抓斗式清污机|螺杆式|卷扬式启闭机|底轴驱动钢坝|污水处理闸门-方源水利机械 | 老房子翻新装修,旧房墙面翻新,房屋防水补漏,厨房卫生间改造,室内装潢装修公司 - 一修房屋快修官网 | 硬度计,金相磨抛机_厂家-莱州华煜众信试验仪器有限公司 | 大米加工设备|大米加工机械|碾米成套设备|大米加工成套设备-河南成立粮油机械有限公司 | 真空吸污车_高压清洗车厂家-程力专用汽车股份有限公司官网 | VI设计-LOGO设计公司-品牌设计公司-包装设计公司-导视设计-杭州易象设计 | 学叉车培训|叉车证报名|叉车查询|叉车证怎么考-工程机械培训网 | 超声波焊接机,振动摩擦焊接机,激光塑料焊接机,超声波焊接模具工装-德召尼克(常州)焊接科技有限公司 | 叉车电池-叉车电瓶-叉车蓄电池-铅酸蓄电池-电动叉车蓄电池生产厂家 | 结晶点测定仪-润滑脂滴点测定仪-大连煜烁| 钢制暖气片散热器_天津钢制暖气片_卡麦罗散热器厂家 | 手持式3d激光扫描仪-便携式三维立体扫描仪-北京福禄克斯 | 陶瓷加热器,履带式加热器-吴江市兴达电热设备厂 | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 金属抛光机-磁悬浮抛光机-磁力研磨机-磁力清洗机 - 苏州冠古科技 | 西安标准厂房_陕西工业厂房_西咸新区独栋厂房_长信科技产业园官方网站 | 山东PE给水管厂家,山东双壁波纹管,山东钢带增强波纹管,山东PE穿线管,山东PE农田灌溉管,山东MPP电力保护套管-山东德诺塑业有限公司 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | 宁夏档案密集柜,智能密集柜,电动手摇密集柜-盛隆柜业宁夏档案密集柜厂家 | 法钢特种钢材(上海)有限公司 - 耐磨钢板、高强度钢板销售加工 阀门智能定位器_电液动执行器_气动执行机构-赫尔法流体技术(北京)有限公司 | LED太阳能中国结|发光红灯笼|灯杆造型灯|节日灯|太阳能灯笼|LED路灯杆装饰造型灯-北京中海轩光电 | 浙江寺庙设计-杭州寺院设计-宁波寺庙规划_汉匠 | 国标白水泥,高标号白水泥,白水泥厂家-淄博华雪建材有限公司 | 双舌接地线-PC68数字式高阻计-ZC36|苏海百科 | 精密模具加工制造 - 富东懿 | 薪动-人力资源公司-灵活用工薪资代发-费用结算-残保金优化-北京秒付科技有限公司 | 干培两用箱-细菌恒温培养箱-菲斯福仪器| 煤机配件厂家_刮板机配件_链轮轴组_河南双志机械设备有限公司 | 安徽成考网-安徽成人高考网 | 低温等离子清洗机(双气路进口)-嘉润万丰 | 杭州可当科技有限公司—流量卡_随身WiFi_AI摄像头一站式解决方案 | 科普仪器菏泽市教育教学仪器总厂 | 马尔表面粗糙度仪-MAHR-T500Hommel-Mitutoyo粗糙度仪-笃挚仪器 | 123悬赏网_发布悬赏任务_广告任务平台 |