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

                          主站蜘蛛池模板: 护栏打桩机-打桩机厂家-恒新重工| 啤酒设备-小型啤酒设备-啤酒厂设备-济南中酿机械设备有限公司 | IHDW_TOSOKU_NEMICON_EHDW系列电子手轮,HC1系列电子手轮-上海莆林电子设备有限公司 | 档案密集柜_手动密集柜_智能密集柜_内蒙古档案密集柜-盛隆柜业内蒙古密集柜直销中心 | 千斤顶,液压千斤顶-力良企业,专业的液压千斤顶制造商,shliliang.com | 盘扣式脚手架-附着式升降脚手架-移动脚手架,专ye承包服务商 - 苏州安踏脚手架工程有限公司 | ERP企业管理系统永久免费版_在线ERP系统_OA办公_云版软件官网 | 广州办公室设计,办公室装修,写字楼设计,办公室装修公司_德科 | 等离子表面处理机-等离子表面活化机-真空等离子清洗机-深圳市东信高科自动化设备有限公司 | 日本东丽膜_反渗透膜_RO膜价格_超滤膜_纳滤膜-北京东丽阳光官网 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 南京展台搭建-南京展会设计-南京展览设计公司-南京展厅展示设计-南京汇雅展览工程有限公司 | 碳纤维布-植筋胶-灌缝胶-固特嘉加固材料公司 | 济南电缆桥架|山东桥架-济南航丰实业有限公司 | 钢木实验台-全钢实验台-化验室通风柜-实验室装修厂家-杭州博扬实验设备 | 工业胀紧套_万向节联轴器_链条-规格齐全-型号选购-非标订做-厂家批发价格-上海乙谛精密机械有限公司 | 华禹护栏|锌钢护栏_阳台护栏_护栏厂家-华禹专注阳台护栏、楼梯栏杆、百叶窗、空调架、基坑护栏、道路护栏等锌钢护栏产品的生产销售。 | 土壤有机碳消解器-石油|表层油类分析采水器-青岛溯源环保设备有限公司 | 锂电混合机-新能源混合机-正极材料混料机-高镍,三元材料混料机-负极,包覆混合机-贝尔专业混合混料搅拌机械系统设备厂家 | 转向助力泵/水泵/发电机皮带轮生产厂家-锦州华一精工有限公司 | POS机官网 - 拉卡拉POS机免费办理|官网在线申请入口 | 掺铥光纤放大器-C/L波段光纤放大器-小信号光纤放大器-合肥脉锐光电技术有限公司 | 深圳高新投三江工业消防解决方案提供厂家_服务商_园区智慧消防_储能消防解决方案服务商_高新投三江 | 通用磨耗试验机-QUV耐候试验机|久宏实业百科 | 萃取箱-萃取槽-PVC萃取箱厂家-混合澄清槽- 杭州南方化工设备 | 石英砂矿石色选机_履带辣椒色选机_X光异物检测机-合肥幼狮光电科技 | 耐火砖厂家,异形耐火砖-山东瑞耐耐火材料厂 | sus630/303cu不锈钢棒,440C/430F/17-4ph不锈钢研磨棒-江苏德镍金属科技有限公司 | LZ-373测厚仪-华瑞VOC气体检测仪-个人有毒气体检测仪-厂家-深圳市深博瑞仪器仪表有限公司 | 垃圾压缩设备_垃圾处理设备_智能移动式垃圾压缩设备--山东明莱环保设备有限公司 | LED灯杆屏_LED广告机_户外LED广告机_智慧灯杆_智慧路灯-太龙智显科技(深圳)有限公司 | 南京泽朗生物科技有限公司 | 无痕胶_可移胶_无痕双面胶带_可移无痕胶厂家-东莞凯峰 | 中开泵,中开泵厂家,双吸中开泵-山东博二泵业有限公司 | 温控器生产厂家-提供温度开关/热保护器定制与批发-惠州市华恺威电子科技有限公司 | 冷藏车-东风吸污车-纯电动环卫车-污水净化车-应急特勤保障车-程力专汽厂家-程力专用汽车股份有限公司销售二十一分公司 | lcd条形屏-液晶长条屏-户外广告屏-条形智能显示屏-深圳市条形智能电子有限公司 | 天然鹅卵石滤料厂家-锰砂滤料-石英砂滤料-巩义东枫净水 | 穿线管|波纹穿线管|包塑金属软管|蛇皮管?闵彬专注弱电工程? | 蜘蛛车-登高车-高空作业平台-高空作业车-曲臂剪叉式升降机租赁-重庆海克斯公司 | 药品冷藏箱厂家_低温冰箱_洁净工作台-济南欧莱博电子商务有限公司官网 | 查分易-成绩发送平台官网 |