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

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

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

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

      反應(yīng)傳單地圖未正確顯示

      react-leaflet map not correctly displayed(反應(yīng)傳單地圖未正確顯示)

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

          <tbody id='dWnH1'></tbody>
        • <legend id='dWnH1'><style id='dWnH1'><dir id='dWnH1'><q id='dWnH1'></q></dir></style></legend>

              <bdo id='dWnH1'></bdo><ul id='dWnH1'></ul>
              <tfoot id='dWnH1'></tfoot>

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

              1. 本文介紹了反應(yīng)傳單地圖未正確顯示的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我正在嘗試使用 react-leaflet 來(lái)顯示地圖.我使用

                這是我的代碼:

                DeviceMap.js

                從'react'導(dǎo)入反應(yīng)從'react-leaflet'導(dǎo)入{地圖,標(biāo)記,彈出窗口,TileLayer};導(dǎo)出類(lèi) DeviceMap 擴(kuò)展 React.Component {構(gòu)造函數(shù)(){極好的();這個(gè).state = {緯度:51.505,液化天然氣:-0.09,縮放:13,};}使成為() {常量位置 = [this.state.lat, this.state.lng];返回 (<地圖中心={position} zoom={this.state.zoom} scrollWheelZoom={false}>

                DeviceTabs.js

                導(dǎo)出類(lèi) DeviceTabs 擴(kuò)展 React.Component {狀態(tài) = {指數(shù):0};handleTabChange = (索引) =>{this.setState({ index })};使成為 () {返回 (<標(biāo)簽索引={this.state.index} onChange={this.handleTabChange}><標(biāo)簽標(biāo)簽='值'><DeviceTable {...this.props}/></標(biāo)簽><標(biāo)簽標(biāo)簽='地圖'><div className={style.leaflet}><設(shè)備映射/></div></標(biāo)簽></標(biāo)簽>)}}

                style.scss

                .leaflet {高度:300px;寬度:100%;}

                控制臺(tái)中沒(méi)有錯(cuò)誤,我不知道在哪里搜索.由于小提琴正在工作,因此它不是錯(cuò)誤.我錯(cuò)過(guò)了什么嗎?

                解決方案

                看起來(lái)你還沒(méi)有加載 Leaflet 樣式表.

                來(lái)自 react-leaflet GitHub 指南:

                <塊引用>

                如果您不熟悉 Leaflet,請(qǐng)確保在使用此庫(kù)之前閱讀其快速入門(mén)指南.您尤其需要將其 CSS 添加到您的頁(yè)面以正確呈現(xiàn)地圖,并設(shè)置容器的高度.

                http://leafletjs.com/examples/quick-start/

                這是你需要的:

                更新

                注意 @ThomasThiebaud 表示您可能還需要設(shè)置 .leaflet-container

                的高度

                --

                Ange Loron 還提供了一個(gè)正確的、可選的 JS 模塊導(dǎo)入(相對(duì)于 cdn 或樣式鏈接)

                導(dǎo)入'leaflet/dist/leaflet.css';



                對(duì)于它的價(jià)值,文檔頁(yè)面設(shè)計(jì)不佳...維護(hù)者在 GitHub 中不斷處理這個(gè)問(wèn)題,但由于某種原因,這個(gè)問(wèn)題是*錯(cuò)誤的用戶(hù)不斷不進(jìn)行所需的設(shè)置./s

                I'm trying to use react-leaflet to display a map. I use the code from this fiddle which is working, but on my computer I have this output

                Here is my code :

                DeviceMap.js

                import React from 'react'
                import { Map, Marker, Popup, TileLayer } from 'react-leaflet';
                
                export class DeviceMap extends React.Component {
                  constructor() {
                    super();
                    this.state = {
                      lat: 51.505,
                      lng: -0.09,
                      zoom: 13,
                    };
                  }
                
                  render() {
                    const position = [this.state.lat, this.state.lng];
                    return (
                      <Map center={position} zoom={this.state.zoom} scrollWheelZoom={false}>
                        <TileLayer
                          attribution='&copy; <a >OpenStreetMap</a> contributors'
                          url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
                        />
                        <Marker position={position}>
                          <Popup>
                            <span>A pretty CSS3 popup. <br/> Easily customizable.</span>
                          </Popup>
                        </Marker>
                      </Map>
                    );
                  }
                }
                
                export default DeviceMap
                

                DeviceTabs.js

                export class DeviceTabs extends React.Component {
                  state = {
                    index: 0
                  };
                
                  handleTabChange = (index) => {
                    this.setState({ index })
                  };
                
                  render () {
                    return (
                      <Tabs index={this.state.index} onChange={this.handleTabChange}>
                        <Tab label='Values'>
                          <DeviceTable {...this.props} />
                        </Tab>
                        <Tab label='Map'>
                          <div className={style.leaflet}>
                            <DeviceMap />
                          </div>
                        </Tab>
                      </Tabs>
                    )
                  }
                }
                

                style.scss

                .leaflet {
                  height: 300px;
                  width: 100%;
                }
                

                There is no error in the console, and I have no more idea where to search. Since the fiddle is working it is not a bug. Did I miss something ?

                解決方案

                Looks like you haven't loaded in the Leaflet stylesheet.

                From the react-leaflet GitHub guide:

                If you are not familiar with Leaflet, make sure you read its quick start guide before using this library. You will notably need to add its CSS to your page to render the map properly, and set the height of the container.

                http://leafletjs.com/examples/quick-start/

                Here is what you'll need:

                <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
                

                Update

                Note @ThomasThiebaud indicates you may also have to set up the height of .leaflet-container

                --

                Ange Loron also gave a correct, optional, JS module import (vs cdn or style link)

                import 'leaflet/dist/leaflet.css';



                For what its worth, the documentation page is poorly designed... and the maintainer continuously deals with this issue in GitHub, but for some reason, the issue is the *fault of the users who continuously don't do the required setup. /s

                這篇關(guān)于反應(yīng)傳單地圖未正確顯示的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(nèi)部)
                Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                Trigger click on leaflet marker(觸發(fā)點(diǎn)擊傳單標(biāo)記)
                How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側(cè)邊欄)
                Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標(biāo)記的緯度和經(jīng)度)

                    <tbody id='2P9Mo'></tbody>
                  • <tfoot id='2P9Mo'></tfoot><legend id='2P9Mo'><style id='2P9Mo'><dir id='2P9Mo'><q id='2P9Mo'></q></dir></style></legend>

                    <small id='2P9Mo'></small><noframes id='2P9Mo'>

                      <bdo id='2P9Mo'></bdo><ul id='2P9Mo'></ul>
                        <i id='2P9Mo'><tr id='2P9Mo'><dt id='2P9Mo'><q id='2P9Mo'><span id='2P9Mo'><b id='2P9Mo'><form id='2P9Mo'><ins id='2P9Mo'></ins><ul id='2P9Mo'></ul><sub id='2P9Mo'></sub></form><legend id='2P9Mo'></legend><bdo id='2P9Mo'><pre id='2P9Mo'><center id='2P9Mo'></center></pre></bdo></b><th id='2P9Mo'></th></span></q></dt></tr></i><div class="exi5sgb" id='2P9Mo'><tfoot id='2P9Mo'></tfoot><dl id='2P9Mo'><fieldset id='2P9Mo'></fieldset></dl></div>
                        1. 主站蜘蛛池模板: 智能汉显全自动量热仪_微机全自动胶质层指数测定仪-鹤壁市科达仪器仪表有限公司 | 刘秘书_你身边专业的工作范文写作小秘书 | 广东风淋室_广东风淋室厂家_广东风淋室价格_广州开源_传递窗_FFU-广州开源净化科技有限公司 | 石家庄律师_石家庄刑事辩护律师_石家庄取保候审-河北万垚律师事务所 | 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 代写标书-专业代做标书-商业计划书代写「深圳卓越创兴公司」 | 艺术涂料|木纹漆施工|稻草漆厂家|马来漆|石桦奴|水泥漆|选加河南天工涂料 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 云南丰泰挖掘机修理厂-挖掘机维修,翻新,再制造的大型企业-云南丰泰工程机械维修有限公司 | 天津散热器_天津暖气片_天津安尼威尔散热器制造有限公司 | 润滑脂-高温润滑脂-轴承润滑脂-食品级润滑油-索科润滑油脂厂家 | 超声骨密度仪-骨密度检测仪-经颅多普勒-tcd仪_南京科进实业有限公司 | 水压力传感器_数字压力传感器|佛山一众传感仪器有限公司|首页 | ge超声波测厚仪-电动涂膜机-电动划格仪-上海洪富| ISO9001认证咨询_iso9001企业认证代理机构_14001|18001|16949|50430认证-艾世欧认证网 | 彼得逊采泥器-定深式采泥器-电动土壤采样器-土壤样品风干机-常州索奥仪器制造有限公司 | 空冷器|空气冷却器|空水冷却器-无锡赛迪森机械有限公司[官网] | 浙江筋膜枪-按摩仪厂家-制造商-肩颈按摩仪哪家好-温州市合喜电子科技有限公司 | 车牌识别道闸_停车场收费系统_人脸识别考勤机_速通门闸机_充电桩厂家_中全清茂官网 | COD分析仪|氨氮分析仪|总磷分析仪|总氮分析仪-圣湖Greatlake | 恒温水槽与水浴锅-上海熙浩实业有限公司 | 定量包装秤,吨袋包装称,伸缩溜管,全自动包装秤,码垛机器人,无锡市邦尧机械工程有限公司 | 瑞典Blueair空气净化器租赁服务中心-专注新装修办公室除醛去异味服务! | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | 阻垢剂-反渗透缓蚀阻垢剂厂家-山东鲁东环保科技有限公司 | 碳纤维布-植筋胶-灌缝胶-固特嘉加固材料公司 | 真空包装机-诸城市坤泰食品机械有限公司 | 电动葫芦|手拉葫芦|环链电动葫芦|微型电动葫芦-北京市凌鹰起重机械有限公司 | GEDORE扭力螺丝刀-GORDON防静电刷-CHEMTRONICS吸锡线-上海卓君电子有限公司 | 沈阳缠绕膜价格_沈阳拉伸膜厂家_沈阳缠绕膜厂家直销 | 运动木地板价格,篮球馆体育运动木地板生产厂家_欧氏地板 | 分子蒸馏设备(短程分子蒸馏装置)_上海达丰仪器| 防爆电机_ybx3系列电机_河南省南洋防爆电机有限公司 | 北京网站建设首页,做网站选【优站网】,专注北京网站建设,北京网站推广,天津网站建设,天津网站推广,小程序,手机APP的开发。 | 密集架-密集柜厂家-智能档案密集架-自动选层柜订做-河北风顺金属制品有限公司 | 517瓜水果特产网|一个专注特产好物的网站 | 恒温振荡混匀器-微孔板振荡器厂家-多管涡旋混匀器厂家-合肥艾本森(www.17world.net) | 环氧乙烷灭菌器_压力蒸汽灭菌器_低温等离子过氧化氢灭菌器 _低温蒸汽甲醛灭菌器_清洗工作站_医用干燥柜_灭菌耗材-环氧乙烷灭菌器_脉动真空压力蒸汽灭菌器_低温等离子灭菌设备_河南省三强医疗器械有限责任公司 | 顶空进样器-吹扫捕集仪-热脱附仪-二次热解吸仪-北京华盛谱信仪器 | 温州中研白癜风专科_温州治疗白癜风_温州治疗白癜风医院哪家好_温州哪里治疗白癜风 |