You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of putting it in my html, I require the plugin like this require('./AnimatedMarker')
And I add this to the end of AnimatedMarker.js module.exports = L.animatedMarker
My custom element looks like this:
require('./AnimatedMarker')
import { MapComponent } from 'react-leaflet'
import L from 'leaflet'
export default class AnimatedMarkerElement extends MapComponent {
componentWillReceiveProps(nextProps) {
const line = L.polyline([nextProps.route.coordinates]),
animatedMarker = L.animatedMarker(line.getLatLngs())
console.log('in componentWillRecieveProps')
nextProps.map.addLayer(animatedMarker)
}
render() {
return null
}
}
The error is: Uncaught TypeError: Cannot read property 'lat' of null
I think that the plugin is looking for a map that it can't find because its burried inside react elements.
The text was updated successfully, but these errors were encountered:
Instead of putting it in my html, I require the plugin like this
require('./AnimatedMarker')
And I add this to the end of AnimatedMarker.js
module.exports = L.animatedMarker
My custom element looks like this:
The error is:
Uncaught TypeError: Cannot read property 'lat' of null
I think that the plugin is looking for a map that it can't find because its burried inside react elements.
The text was updated successfully, but these errors were encountered: