Leaflet 在react中将Geojson层添加到传单地图后,矢量平铺层的交互性丢失

Leaflet 在react中将Geojson层添加到传单地图后,矢量平铺层的交互性丢失,leaflet,geojson,interaction,react-leaflet,vector-tiles,Leaflet,Geojson,Interaction,React Leaflet,Vector Tiles,传单。用于反应传单的包装层。覆盖层中有很多这样的平铺层,还有一些其他层使用react传单的GeoJSON组件直接导入json数据。一切正常,但如果我先加载geojson层,我就失去了矢量平铺层的交互性。加载精细但不可单击的图层或其他样式选项未在地图中渲染。如果不加载geojson层,它们就可以工作 代码中的简单用法: <Overlay name="Turkey Counties"> <TRCountiesGeoJSON r

传单。用于反应传单的包装层。覆盖层中有很多这样的平铺层,还有一些其他层使用react传单的GeoJSON组件直接导入json数据。一切正常,但如果我先加载geojson层,我就失去了矢量平铺层的交互性。加载精细但不可单击的图层或其他样式选项未在地图中渲染。如果不加载geojson层,它们就可以工作

代码中的简单用法:

        <Overlay name="Turkey Counties">
          <TRCountiesGeoJSON ref="TRCountiesGeoJSON" />
        </Overlay>

        <Overlay  name="Sentinel-2 Grid">
          <WrappedVectorTileLayer {...sentineloptions}
            // onClick={function (layer) {
            //   console.log("layer: ", layer);
            // }}
            onClick={(e) => this.handleSentinelGridClick(e)}
            url={this.state.geojsonUrl + "/sentinel2grid/{z}/{x}/{y}.pbf"}
          />
        </Overlay>

this.handleSentinelGridClick(e)}
url={this.state.geojsonUrl+“/sentinel2grid/{z}/{x}/{y}.pbf}
/>
矢量图块的实现来自@willfalconer的