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. 主站蜘蛛池模板: 济南品牌包装设计公司_济南VI标志设计公司_山东锐尚文化传播 | led冷热冲击试验箱_LED高低温冲击试验箱_老化试验箱-爱佩百科 | 【同风运车官网】一站式汽车托运服务平台,验车满意再付款 | 数码听觉统合训练系统-儿童感觉-早期言语评估与训练系统-北京鑫泰盛世科技发展有限公司 | 玻璃钢型材-玻璃钢风管-玻璃钢管道,生产厂家-[江苏欧升玻璃钢制造有限公司] | 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 - 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 | 防爆暖风机_防爆电暖器_防爆电暖风机_防爆电热油汀_南阳市中通智能科技集团有限公司 | 间苯二酚,间苯二酚厂家-淄博双和化工 | 集装箱展厅-住人集装箱住宿|建筑|房屋|集装箱售楼处-山东锐嘉科技工程有限公司 | 美的商用净水器_美的直饮机_一级代理经销商_Midea租赁价格-厂家反渗透滤芯-直饮水批发品牌售后 | 塑料检查井_双扣聚氯乙烯增强管_双壁波纹管-河南中盈塑料制品有限公司 | 结晶点测定仪-润滑脂滴点测定仪-大连煜烁 | 吸音板,隔音板,吸音材料,吸音板价格,声学材料 - 佛山诺声吸音板厂家 | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 鹤壁创新仪器公司-全自动量热仪,定硫仪,煤炭测硫仪,灰熔点测定仪,快速自动测氢仪,工业分析仪,煤质化验仪器 | 进口便携式天平,外校_十万分之一分析天平,奥豪斯工业台秤,V2000防水秤-重庆珂偌德科技有限公司(www.crdkj.com) | 集装袋吨袋生产厂家-噸袋廠傢-塑料编织袋-纸塑复合袋-二手吨袋-太空袋-曹县建烨包装 | 培训无忧网-教育培训咨询招生第三方平台 | 运动木地板厂家_体育木地板安装_篮球木地板选购_实木运动地板价格 | 成都热收缩包装机_袖口式膜包机_高速塑封机价格_全自动封切机器_大型套膜机厂家 | 胶原检测试剂盒,弹性蛋白检测试剂盒,类克ELISA试剂盒,阿达木单抗ELISA试剂盒-北京群晓科苑生物技术有限公司 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 仓储笼_金属箱租赁_循环包装_铁网箱_蝴蝶笼租赁_酷龙仓储笼租赁 测试治具|过炉治具|过锡炉治具|工装夹具|测试夹具|允睿自动化设备 | 强效碱性清洗剂-实验室中性清洗剂-食品级高纯氮气发生器-上海润榕科学器材有限公司 | 合肥地磅_合肥数控切割机_安徽地磅厂家_合肥世佳电工设备有限公司 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 超声骨密度仪,双能X射线骨密度仪【起草单位】,骨密度检测仪厂家 - 品源医疗(江苏)有限公司 | 电渗析,废酸回收,双极膜-山东天维膜技术有限公司 | 耐酸碱胶管_耐腐蚀软管总成_化学品输送软管_漯河利通液压科技耐油耐磨喷砂软管|耐腐蚀化学软管 | 广州中央空调回收,二手中央空调回收,旧空调回收,制冷设备回收,冷气机组回收公司-广州益夫制冷设备回收公司 | 明渠式紫外线杀菌器-紫外线消毒器厂家-定州市优威环保 | 北京三友信电子科技有限公司-ETC高速自动栏杆机|ETC机柜|激光车辆轮廓测量仪|嵌入式车道控制器 | 镀锌钢格栅_热镀锌格栅板_钢格栅板_热镀锌钢格板-安平县昊泽丝网制品有限公司 | 餐饮小吃技术培训-火锅串串香培训「何小胖培训」_成都点石成金[官网] | 北京普辉律师事务所官网_北京律师24小时免费咨询|法律咨询 | 搪玻璃冷凝器_厂家-越宏化工设备 | 空气能暖气片,暖气片厂家,山东暖气片,临沂暖气片-临沂永超暖通设备有限公司 | 无痕胶_可移胶_无痕双面胶带_可移无痕胶厂家-东莞凯峰 | 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 |