pyqtlet2
pyqtlet2 copied to clipboard
Map.js:1092 Uncaught Error: Map container is already initialized.
Getting error in the following code .tried everything to resolve couldnt figure it out. Error: Map.js:1092 Uncaught Error: Map container is already initialized. import React, { Component } from "react"; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import { Card, Row, Col, CardHeader, CardBody, Badge } from "reactstrap";
class Map extends Component {
render() { return ( <div className="Map"> <h1 className="App_tilte"> Open Street Map <Col> <Card> <CardBody>
<MapContainer
center={[33.6844, 73.0479]}
zoom={1}
scrollWheelZoom={false}
>
<TileLayer
attribution='<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>'
url="https://api.maptiler.com/maps/basic-v2/256/{z}/{x}/{y}.png?key=Y1H1qhyFkWqTvXcK7kj"
/>
<Marker position={[33.6844, 73.0479]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
</CardBody>
</Card>
</Col>
</div>
);
} }
export default Map;
Hey @Sidra1111 I could you provide more information? There is to little information for me to deal with this issue.
Couldn't implement map using map container asvit always give me error that map container is already initialized though i haven't used it already. Somehow i managed to implement map without using map container
Is the example in the readme, behaving the same for you, or is it working? The errors in regards to being already initialized, are sometimes a bit misleading.