anarqz / react-leaflet-animated-marker

An animated marker to use with react-leaflet
https://www.npmjs.com/package/react-leaflet-animated-marker
MIT License
3 stars 0 forks source link

TypeError: Cannot read property 'lat' of undefined #2

Closed A6Hz closed 4 years ago

A6Hz commented 5 years ago

project node_modules/leaflet/dist/leaflet-src.js:1540

1537 | project: function project(latlng) { 1538 | var d = Math.PI / 180, 1539 | max = this.MAX_LATITUDE, 1540 | lat = Math.max(Math.min(max, latlng.lat), -max), // <-- ERROR 1541 | sin = Math.sin(lat d);
1542 | return new Point(this.R
latlng.lng d, this.R Math.log((1 + sin) / (1 - sin)) / 2); 1543 | },`

....

here my code:

import Marker from "react-leaflet-animated-marker"; const position = { lat: 24.37, lng: -238 }; `

A pretty CSS3 popup.
Easily customizable.
    </Marker>`
marcinbittel commented 4 years ago

You provide position2 to prop position but your const is called position, not position2. it should be: <Marker position={position} ...