版本:传单 - 1.3.4
反应传单 - 2.0.1
传单绘制 - 1.0.4
反应传单绘制-0.19.8
代码:
import { Map, TileLayer, Marker, Popup } from "react-leaflet";
import { EditControl } from "react-leaflet-draw";
import "./styles.css";
class App extends Component {
state = {
center: [51.505, -0.091],
zoom: 13
};
render() {
return (
<div>
<Map center={this.state.center} zoom={this.state.zoom}>
<TileLayer
attribution='&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.osm.org/{z}/{x}/{y}.png"
/>
<Marker position={this.state.center}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</Map>
</div>
);
}
}
错误:
找不到依赖项:'@react-leaflet/core' 相对于'/node_modules/react-leaflet-draw/dist/esm/EditControl.js'
我尝试将 react-leaflet 升级到 3.x,但同样的错误。