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

      <tfoot id='1w620'></tfoot>
      <legend id='1w620'><style id='1w620'><dir id='1w620'><q id='1w620'></q></dir></style></legend>
      1. <small id='1w620'></small><noframes id='1w620'>

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

        Leaflet _ ReactJS - 在哪里可以找到 invalidateSize 屬性

        Leaflet _ ReactJS - Where to find the invalidateSize property?(Leaflet _ ReactJS - 在哪里可以找到 invalidateSize 屬性?)
      2. <legend id='0u0u2'><style id='0u0u2'><dir id='0u0u2'><q id='0u0u2'></q></dir></style></legend>

            <tfoot id='0u0u2'></tfoot>
                <tbody id='0u0u2'></tbody>
              • <bdo id='0u0u2'></bdo><ul id='0u0u2'></ul>

                <small id='0u0u2'></small><noframes id='0u0u2'>

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

                  本文介紹了Leaflet _ ReactJS - 在哪里可以找到 invalidateSize 屬性?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我試圖在以下位置找到它:

                  I have tried to find it in:

                  • this.mapRef.current.leafletElement
                  • this.mapRef.current.getLeafletElement()
                    • 使 this.mapRef.current.getLeafletElement().invalidateSize 失效

                    這里是我的反應片段:

                    import React, {Component, Fragment} from "react"; 
                    
                    import L from "leaflet" 
                    import   "~/lib/leaflet/leaflet.css"
                    import "~/lib/leaflet/leaflet"
                    import styled from "styled-components"
                    import Head from 'next/head' 
                    
                    constructor(props) {
                        super(props);
                        this.mapRef = React.createRef();
                      }
                    
                     componentDidMount(){  
                    
                        // console.log("this.map: ", this.map);
                        console.log("this.refs.mapTest: ", this.mapRef.current.leafletElement 
                    
                    // or other trial)
                    
                    {...}
                      this.map= L.map("map", {   
                          center:location,
                          zoom:12,
                          zoomControl:true
                      })
                    {...}
                    
                     } 
                    
                    
                    
                     render(){ 
                        return (
                          <Fragment>
                              <Head>
                              <link />
                              <link />
                    
                              <link rel="stylesheet" 
                       integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
                       crossorigin=""/> 
                    
                         <script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
                       integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
                       crossorigin=""></script>   
                              </Head>
                            <Wrapper 
                              ref={this.mapRef}
                              width="100%" 
                              height="80vh" 
                              id="map"
                            /> 
                          </Fragment>
                        )
                      }
                    } 
                    

                    我找不到invalidateSize的屬性,

                    I cant find the invalidateSize's property,

                    任何提示都會很棒,謝謝

                    any hint would be great, thanks

                    推薦答案

                    如果你在 componentDidMount 內登錄,則引用 Map

                    If you log inside componentDidMount the reference to the Map

                    componentDidMount() {
                        const map = this.mapRef.leafletElement;
                        console.log(map)
                    } 
                    

                    _zoomBoundLayers: {26: NewClass}__proto__:NewClass底部的控制臺展開,你可以看到繼承的方法和invalidateSize 被顯示出來,因此在那里提供.

                    and expand in the console on the bottom __proto__: NewClass under _zoomBoundLayers: {26: NewClass} you can see the methods that are inherited and that invalidateSize is displayed and therefore provided there.

                    編輯

                    我以為你在使用 react-leaflet.

                    I thought you were using react-leaflet.

                    在不使用 react 傳單的情況下,您可以使用以下代碼獲取對地圖實例的引用.

                    Without the use of react leaflet you can use the following code to get a reference to the map instance.

                    class Map extends Component {
                      componentDidMount() {
                        const map = this.map = L.map('map').setView([51.505, -0.09], 13);
                    
                        L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
                          maxZoom: 18,
                          attribution: 'Map data &copy; <a >OpenStreetMap</a> contributors, ' +
                            '<a  +
                            'Imagery ? <a ,
                          id: 'mapbox.streets'
                        }).addTo(map);
                    
                        console.log(this.map)
                      }
                    
                      render() {
                        return (
                            <div id="map"/>
                        );
                      }
                    }
                    

                    然后和 react-leaflet 版本一樣:在控制臺底部展開 __proto__:NewClass_zoomBoundLayers: {26: NewClass} 可以看到繼承的方法,并且 invalidateSize 顯示并因此提供在那里.

                    and then do as in the react-leaflet version: expand in the console on the bottom __proto__: NewClass under _zoomBoundLayers: {26: NewClass} you can see the methods that are inherited and that invalidateSize is displayed and therefore provided there.

                    演示

                    這篇關于Leaflet _ ReactJS - 在哪里可以找到 invalidateSize 屬性?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中的默認加載磁貼顏色?)
                  Add external geojson to leaflet layer(將外部geojson添加到傳單層)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側邊欄)
                  • <legend id='yd5Ef'><style id='yd5Ef'><dir id='yd5Ef'><q id='yd5Ef'></q></dir></style></legend>
                        <bdo id='yd5Ef'></bdo><ul id='yd5Ef'></ul>
                            <tbody id='yd5Ef'></tbody>
                        • <small id='yd5Ef'></small><noframes id='yd5Ef'>

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

                            <tfoot id='yd5Ef'></tfoot>

                          1. 主站蜘蛛池模板: 天然气分析仪-液化气二甲醚分析仪|传昊仪器 | 深圳美安可自动化设备有限公司,喷码机,定制喷码机,二维码喷码机,深圳喷码机,纸箱喷码机,东莞喷码机 UV喷码机,日期喷码机,鸡蛋喷码机,管芯喷码机,管内壁喷码机,喷码机厂家 | 环讯传媒,永康网络公司,永康网站建设,永康小程序开发制作,永康网站制作,武义网页设计,金华地区网站SEO优化推广 - 永康市环讯电子商务有限公司 | 天津仓库出租网-天津电商仓库-天津云仓一件代发-【博程云仓】 | 广州活动策划公司-15+年专业大型公关活动策划执行管理经验-睿阳广告 | 罗氏牛血清白蛋白,罗氏己糖激酶-上海嵘崴达实业有限公司 | 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 户外-组合-幼儿园-不锈钢-儿童-滑滑梯-床-玩具-淘气堡-厂家-价格 | 乐泰胶水_loctite_乐泰胶_汉高乐泰授权(中国)总代理-鑫华良供应链 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | GEDORE扭力螺丝刀-GORDON防静电刷-CHEMTRONICS吸锡线-上海卓君电子有限公司 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 鹤壁创新仪器公司-全自动量热仪,定硫仪,煤炭测硫仪,灰熔点测定仪,快速自动测氢仪,工业分析仪,煤质化验仪器 | 小型玉石雕刻机_家用玉雕机_小型万能雕刻机_凡刻雕刻机官网 | 青岛代理记账_青岛李沧代理记账公司_青岛崂山代理记账一个月多少钱_青岛德辉财税事务所官网 | DWS物流设备_扫码称重量方一体机_快递包裹分拣机_广东高臻智能装备有限公司 | ★店家乐|服装销售管理软件|服装店收银系统|内衣店鞋店进销存软件|连锁店管理软件|收银软件手机版|会员管理系统-手机版,云版,App | 云南标线|昆明划线|道路标线|交通标线-就选云南云路施工公司-云南云路科技有限公司 | 大倾角皮带机-皮带输送机-螺旋输送机-矿用皮带输送机价格厂家-河南坤威机械 | 污水/卧式/潜水/钻井/矿用/大型/小型/泥浆泵,价格,参数,型号,厂家 - 安平县鼎千泵业制造厂 | 河北中仪伟创试验仪器有限公司是专业生产沥青,土工,水泥,混凝土等试验仪器的厂家,咨询电话:13373070969 | 成都茶楼装修公司 - 会所设计/KTV装修 - 成都朗煜装饰公司 | 食品无尘净化车间,食品罐装净化车间,净化车间配套风淋室-青岛旭恒洁净技术有限公司 | 石英砂矿石色选机_履带辣椒色选机_X光异物检测机-合肥幼狮光电科技 | 护腰带生产厂家_磁石_医用_热压护腰_登山护膝_背姿矫正带_保健护具_医疗护具-衡水港盛 | 渣土车电机,太阳能跟踪器电机,蜗轮蜗杆减速电机厂家-淄博传强电机 | 壹车网 | 第一时间提供新车_资讯_报价_图片_排行! | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | 恒温槽_恒温水槽_恒温水浴槽-上海方瑞仪器有限公司 | 深圳网站建设-高端企业网站开发-定制网页设计制作公司 | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 济南玻璃安装_济南玻璃门_济南感应门_济南玻璃隔断_济南玻璃门维修_济南镜片安装_济南肯德基门_济南高隔间-济南凯轩鹏宇玻璃有限公司 | 宽带办理,电信宽带,移动宽带,联通宽带,电信宽带办理,移动宽带办理,联通宽带办理 | YJLV22铝芯铠装电缆-MYPTJ矿用高压橡套电缆-天津市电缆总厂 | 活性氧化铝|无烟煤滤料|活性氧化铝厂家|锰砂滤料厂家-河南新泰净水材料有限公司 | 铁艺,仿竹,竹节,护栏,围栏,篱笆,栅栏,栏杆,护栏网,网围栏,厂家 - 河北稳重金属丝网制品有限公司 山东太阳能路灯厂家-庭院灯生产厂家-济南晟启灯饰有限公司 | 旅游规划_旅游策划_乡村旅游规划_景区规划设计_旅游规划设计公司-北京绿道联合旅游规划设计有限公司 | 不锈钢水管-不锈钢燃气管-卫生级不锈钢管件-不锈钢食品级水管-广东双兴新材料集团有限公司 | 筒瓦厂家-仿古瓦-寺庙-古建琉璃瓦-宜兴市古典园林建筑陶瓷厂有限公司 | 阿米巴企业经营-阿米巴咨询管理-阿米巴企业培训-广东键锋企业管理咨询有限公司 | 商标转让-商标注册-商标查询-软著专利服务平台 - 赣江万网 |