pyqtlet2 icon indicating copy to clipboard operation
pyqtlet2 copied to clipboard

Map.js:1092 Uncaught Error: Map container is already initialized.

Open Sidra1111 opened this issue 2 years ago • 3 comments

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">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; 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;

Sidra1111 avatar Aug 10 '22 10:08 Sidra1111

Hey @Sidra1111 I could you provide more information? There is to little information for me to deal with this issue.

JaWeilBaum avatar Sep 14 '22 15:09 JaWeilBaum

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

Sidra1111 avatar Sep 15 '22 12:09 Sidra1111

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.

JaWeilBaum avatar Sep 16 '22 07:09 JaWeilBaum